#define INTROBTN 13
#define HORNBTN 11
-#define UNPRELL 250
-#define LOOPDELAY 600
+#define UNPRELL 150
+#define LOOPDELAY 300
volatile bool running = true;
static volatile bool pwrOn = false;
pullUpDnControl(CHNL2BTN, PUD_UP);
pullUpDnControl(INTROBTN, PUD_UP);
pullUpDnControl(HORNBTN, PUD_UP);
- if (wiringPiISR(PWRBTN, INT_EDGE_RISING, pwrBtn)) printf("failed to initialize pwrBtn\n");
- if (wiringPiISR(CHNL1BTN, INT_EDGE_RISING, chnl1Btn)) printf("failed to initialize chnl1Btn\n");
- if (wiringPiISR(CHNL2BTN, INT_EDGE_RISING, chnl2Btn)) printf("failed to initialize chnl2Btn\n");
- if (wiringPiISR(INTROBTN, INT_EDGE_RISING, introBtn)) printf("failed to initialize introBtn\n");
- if (wiringPiISR(HORNBTN, INT_EDGE_RISING, hornBtn)) printf("failed to initialize hornBtn\n");
+ if (wiringPiISR(PWRBTN, INT_EDGE_FALLING, pwrBtn)) printf("failed to initialize pwrBtn\n");
+ if (wiringPiISR(CHNL1BTN, INT_EDGE_FALLING, chnl1Btn)) printf("failed to initialize chnl1Btn\n");
+ if (wiringPiISR(CHNL2BTN, INT_EDGE_FALLING, chnl2Btn)) printf("failed to initialize chnl2Btn\n");
+ if (wiringPiISR(INTROBTN, INT_EDGE_FALLING, introBtn)) printf("failed to initialize introBtn\n");
+ if (wiringPiISR(HORNBTN, INT_EDGE_FALLING, hornBtn)) printf("failed to initialize hornBtn\n");
printf("Set LED pins to output\n");
pinMode(PWRLED, OUTPUT);