Created
August 28, 2013 12:01
-
-
Save bangonkali/6365221 to your computer and use it in GitHub Desktop.
Blinking pin1 of Cubieboard 2. Uses https://github.com/gootoomoon/WiringCB-python
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
#include <stdio.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <wiringPi.h> | |
#define OUTPUT 1 | |
#define HIGH 1 | |
#define LOW 0 | |
#define MIN_PIN 50 | |
int pin = MIN_PIN; | |
int main() | |
{ | |
if(wiringPiSetupPhys() == -1) | |
{ | |
fprintf(stdout, "wiring lib init error:%s", strerror(errno)); | |
return 1; | |
} | |
for(;;){ | |
printf("wiring at pin %d.\n", pin); | |
pinMode(pin,OUTPUT); | |
digitalWrite(pin,HIGH); | |
delay(500); | |
digitalWrite(pin,LOW); | |
delay(500); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment