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

2Buttons.h

Committer:
fusop
Date:
2017-04-19
Revision:
0:63db1c7ee975

File content as of revision 0:63db1c7ee975:


//------------------------------------------------------------------------------
//                           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);
}