Created
June 15, 2012 22:33
-
-
Save t3db0t/2939020 to your computer and use it in GitHub Desktop.
Raspberry Pi test program using wiringPi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* blink.c: | |
* Simple test program to blink an LED on pin 7 | |
*/ | |
#include <wiringPi.h> | |
#include <stdio.h> | |
int main (void) | |
{ | |
int pin = 7; | |
printf("Raspberry Pi wiringPi blink test\n"); | |
if (wiringPiSetup() == -1) | |
exit (1); | |
pinMode(pin, OUTPUT); | |
for (;;){ | |
printf("LED On\n"); | |
digitalWrite(pin, 1); | |
delay(250); | |
printf("LED Off\n"); | |
digitalWrite(pin, 0); | |
delay(250); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment