Skip to content

Instantly share code, notes, and snippets.

@bangonkali
Created August 28, 2013 12:01
Show Gist options
  • Save bangonkali/6365221 to your computer and use it in GitHub Desktop.
Save bangonkali/6365221 to your computer and use it in GitHub Desktop.
Blinking pin1 of Cubieboard 2. Uses https://github.com/gootoomoon/WiringCB-python
#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