parent
11bca2e5a5
commit
892a4a10c2
5 changed files with 24 additions and 1 deletions
Binary file not shown.
@ -0,0 +1,22 @@ |
|||||||
|
#include <pigpio.h> |
||||||
|
#include <stdio.h> |
||||||
|
|
||||||
|
#define DCD_LED 17 |
||||||
|
|
||||||
|
int main() |
||||||
|
{ |
||||||
|
if (gpioInitialise() < 0) |
||||||
|
{ |
||||||
|
// pigpio initialisation failed.
|
||||||
|
printf("pigpio failed"); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
// pigpio initialised okay.
|
||||||
|
gpioSetMode(DCD_LED, PI_OUTPUT); // Set DCD_LED as output
|
||||||
|
gpioWrite(DCD_LED, 1); // Set DCD_LED high
|
||||||
|
gpioSleep(PI_TIME_RELATIVE, 1, 0); // sleep for one second
|
||||||
|
gpioWrite(DCD_LED, 0); // Set DCD_LED low
|
||||||
|
gpioTerminate(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1 @@ |
|||||||
|
gcc -Wall -pthread -o prog dcd.c -lpigpio -lrt |
Binary file not shown.
Loading…
Reference in new issue