- #include <stdio.h>
- #include <wiringPi.h>
- // LED Pin - wiringPi pin 30 is GPIO2A7 71.
- #define LED 30
- int main (void)
- {
- printf ("Tinker board 2 blink\n") ;
- wiringPiSetup () ;
- pinMode (LED, OUTPUT) ;
- for (;;)
- {
- digitalWrite (LED, HIGH) ; // On
- delay (500) ; // mS
- digitalWrite (LED, LOW) ; // Off
- delay (500) ;
- }
- return 0 ;
- }
复制代码
LED 闪烁的sample代码,请参考。 |