Sensorian
1.0
C API Reference Guide Library
Main Page
Related Pages
Modules
Data Structures
Files
Examples
File List
Globals
main.c
Go to the documentation of this file.
1
/****************************************************************************
2
* Copyright (C) 2015 Sensorian
3
* *
4
* This file is part of Sensorian. *
5
* *
6
* Sensorian is free software: you can redistribute it and/or modify it *
7
* under the terms of the GNU Lesser General Public License as published *
8
* by the Free Software Foundation, either version 3 of the License, or *
9
* (at your option) any later version. *
10
* *
11
* Sensorian is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU Lesser General Public License for more details. *
15
* *
16
* You should have received a copy of the GNU Lesser General Public *
17
* License along with Sensorian. *
18
* If not, see <http://www.gnu.org/licenses/>. *
19
****************************************************************************/
20
28
#include <bcm2835.h>
29
#include <stdio.h>
30
#include "
Utilities.h
"
31
32
int
main
(
int
argc,
char
**argv)
33
{
34
if
(!bcm2835_init())
//Configure I2C pins
35
{
36
printf(
"BCM libray error.\n"
);
37
}
38
39
printf(
"LED blinking demo with the Sensorian Shield.\r\n"
);
40
pinModeOutput
(
LED_PIN
);
41
42
while
(1)
43
{
44
digitalWrite
(
LED_PIN
, HIGH);
45
46
delay_ms
(1000);
47
48
digitalWrite
(
LED_PIN
, LOW);
49
50
delay_ms
(1000);
51
}
52
53
bcm2835_close();
54
return
0;
55
}
56
pinModeOutput
void pinModeOutput(PIN_t pin)
Configures the given pin as output.
Definition:
Utilities.c:49
main
int main(int argc, char **argv)
Definition:
main.c:34
Utilities.h
Utilities driver header.
delay_ms
void delay_ms(unsigned int ms)
Delay in ms.
Definition:
Utilities.c:39
digitalWrite
void digitalWrite(PIN_t pin, unsigned char level)
Write a logic level to the pin. The pin should be confgured as output.
Definition:
Utilities.c:60
LED_PIN
#define LED_PIN
Definition:
Utilities.h:46
LED
Example1
main.c
Generated on Sun Jul 12 2015 20:25:27 for Sensorian by
1.8.9.1