Ben Gordon
/
ELEC351_GroupA-branch1
Troubleshooting
Diff: displayThread.cpp
- Revision:
- 13:d49ec153d644
- Child:
- 14:9d4c24c3c696
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/displayThread.cpp Thu Nov 08 22:39:14 2018 +0000 @@ -0,0 +1,32 @@ +#include "displayThread.h" + +InterruptIn button1(b1); +InterruptIn button2(b2); + +U_BYTE buttonPressed; + +void displayFunction() +{ + buttonPressed = 0; + button1.rise(&buttonTrigger1); + button2.rise(&buttonTrigger2); + Display display(RS,E,d4,d5,d6,d7); //rs,e,d4,d5,d6,d7 + display.INIT(); + while(1) + { + if((buttonPressed&1) == 1) + { + display.pageTwo(); + } + } +} + +void buttonTrigger1() +{ + buttonPressed |= 1; //set first bit +} + +void buttonTrigger2() +{ + buttonPressed |= 2; //set second bit +} \ No newline at end of file