Created
October 19, 2016 14:20
-
-
Save littlekbt/3c20f9cad8ad9c8e4ae4f84a886f6e29 to your computer and use it in GitHub Desktop.
This file contains 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
# command | |
# pi, gpio, wiringPi mapping confirm | |
# $ gpio readall | |
# use wiringPi pin number | |
# $ gpio mode [pin no] out | |
# $ gpio write [pin no] 1 | |
# $ gpio write [pin no] 0 | |
# use pi pin number | |
# $ gpio mode -1 [pin no] out | |
# $ gpio write -1 [pin no] 1 | |
# $ gpio write -1 [pin no] 0 | |
# use gpio -g pin number | |
# $ gpio mode -g [pin no] out | |
# $ gpio write -g [pin no] 1 | |
# $ gpio write -g [pin no] out | |
# https://tool-lab.com/make/raspberrypi-startup-24/ | |
#################################################### | |
# program | |
#include "./wiringPi/wiringPi.h" | |
#include <stdio.h> | |
#define WRITE_PIN 8 | |
void main() | |
{ | |
if(wiringPiSetup() == -1){ | |
printf("error wiringPi setup\n"); | |
return; | |
} | |
pinMode(WRITE_PIN, OUTPUT); | |
while(1) { | |
digitalWrite(WRITE_PIN, 0); //LED off | |
delay(1000); //wait 1000ms | |
digitalWrite(WRITE_PIN, 1); //LED on | |
delay(1000); //wait 1000ms | |
} | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment