Skip to content

Instantly share code, notes, and snippets.

@tumugin
Last active December 5, 2016 08:39
Show Gist options
  • Save tumugin/ee2b59e73cea9e3962c1d0cf34e4f58f to your computer and use it in GitHub Desktop.
Save tumugin/ee2b59e73cea9e3962c1d0cf34e4f58f to your computer and use it in GitHub Desktop.
gcc -I/usr/local/include -L/lib test.c -o test -lwiringPi
#include <wiringPi.h>
#include <stdio.h>
int main (void)
{
int pin = 1; // GPIO PD14
if (wiringPiSetup() == -1)
return 1;
printf("setupOK\n");
pinMode(pin, OUTPUT);
while (1)
{
printf("loop\n");
digitalWrite(pin, 1);
delay(1000);
digitalWrite(pin, 0);
delay(1000);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment