A simple reminder program that can store up to 5 reminders, and has the ability to navigate between different pages through different functions.
Dependencies: Hexi_KW40Z Hexi_OLED_SSD1351 PWM_Tone_Library
Diff: 2Buttons.h
- Revision:
- 0:63db1c7ee975
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2Buttons.h Wed Apr 19 14:57:15 2017 +0000 @@ -0,0 +1,67 @@ + +//------------------------------------------------------------------------------ +// BUTTON DEFINTIIONS +//------------------------------------------------------------------------------ + +void BU(void) +{ + red = 1; + green = 1; + blue = 0; + + B_response(1); +} + +void BD(void) +{ + red = 0; + green = 1; + blue = 1; + + B_response(2); +} + +void BR(void) +{ + red = 1; + green = 0; + blue = 1; + + B_response(4); +} + +void BL(void) +{ + red = 1; + green = 1; + blue = 1; + + B_response(3); +} + +void BS(void) +{ + red = 0; + green = 0; + blue = 0; +} + +//Attach callback functions +void B_attach(void) +{ + butt.attach_buttonUp(&BU); + butt.attach_buttonDown(&BD); + butt.attach_buttonLeft(&BL); + butt.attach_buttonRight(&BR); + butt.attach_buttonSlide(&BS); +} + +void B_response(int k) +{ + butflg = 1; //For any program that needs button feedback + vibflg = 1; //For button haptic feedback + butmem = k; //Type of button pressed + + //Buzzer Part + Tune(buzz, Cs5, 2); +}