// WiringPi test program: Kernel char device interface / sysfs successor // Compile: gcc -Wall wiringpi_test1_device.c -o wiringpi_test1_device -lwiringPi #include "wpi_test.h" #include #include #include int GPIO = 19; int GPIOIN = 26; const int ToggleValue = 4; int main (void) { printf("WiringPi GPIO test program 1 (using GPIO%d (output) and GPIO%d (input) via sys)\n", GPIO, GPIOIN); printf(" testing digitalWrite, digitalRead and pullUpDnControl\n"); if (wiringPiSetupSys() == -1) { printf("wiringPiSetupSys failed\n\n"); exit(EXIT_FAILURE); } if (!piBoard40Pin()) { GPIO = 23; GPIOIN = 24; } pinMode(GPIOIN, INPUT); pinMode(GPIO, OUTPUT); printf("toggle %d times ...\n", ToggleValue); for (int loop=1; loop