Raspberry Pi/WiringPi simple example
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
#include <wiringPi.h> | |
const int ledPin = 18; | |
int main(void) | |
{ | |
wiringPiSetupGpio(); | |
pinMode(ledPin, OUTPUT); | |
for (;;) | |
{ | |
digitalWrite(ledPin, HIGH); | |
delay(500); | |
digitalWrite(ledPin, LOW); | |
delay(500); | |
} | |
return 0; | |
} | |
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
LDLIBS=-lwiringPi | |
blink: blink.c | |
run: blink | |
sudo ./blink | |
.PHONY: run | |
clean: | |
$(RM) blink | |
.PHONY: clean | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A GForth port of this example is available here: https://gist.github.com/kristopherjohnson/e7d3f7547eb5e1c65aff