4 * Simple test for the PiFace
6 * Read the buttons and output the same to the LEDs
15 int outputs [4] = { 0,0,0,0 } ;
17 void scanButton (int button)
19 if (digitalRead (button) == LOW)
21 outputs [button] ^= 1 ;
22 digitalWrite (button, outputs [button]) ;
25 while (digitalRead (button) == LOW)
34 printf ("Raspberry Pi wiringPiFace test program\n") ;
36 if (wiringPiSetupPiFace () == -1)
39 // Enable internal pull-ups
41 for (pin = 0 ; pin < 8 ; ++pin)
42 pullUpDnControl (pin, PUD_UP) ;
47 for (button = 0 ; button < 4 ; ++button)