Sensorian  1.0
C API Reference Guide Library
Blinky.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("Blinking LED demo with the Sensorian Shield.\r\n");
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 
void pinModeOutput(PIN_t pin)
Configures the given pin as output.
Definition: Utilities.c:49
int main(int argc, char **argv)
Definition: Blinky.c:32
void delay_ms(unsigned int ms)
Delay in ms.
Definition: Utilities.c:39
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
#define LED_PIN
Definition: Utilities.h:46