![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Rev 1.6 - Sample Period Work in progress
Dependencies: mbed Bitmap N5110 TMP102 Joystick
Diff: main.cpp
- Revision:
- 10:d98b2dd7ba09
- Parent:
- 9:77a6ea988e01
- Child:
- 11:d8bd197a5e7b
diff -r 77a6ea988e01 -r d98b2dd7ba09 main.cpp --- a/main.cpp Sat Jan 08 18:29:45 2022 +0000 +++ b/main.cpp Sat Jan 08 18:44:34 2022 +0000 @@ -46,6 +46,7 @@ void init_K64F(); // K64F Disabling Onboard Components Function void R_isr(); void L_isr(); +void info(); /*======================== Main Function =====================================*/ int main() @@ -70,6 +71,15 @@ // read temperature and print over serial port float T = tmp102.get_temperature(); // Reading Temperature as a floating variable float Set = SP * 100; // Reading Potentiometer as a floating variable. Multiplied by 100 to give larger range + + while (g_R_flag){ // Condition to change over into new loop + g_R_flag = 0; // When the R Flag has been pressed + R.rise(&R_isr); + info(); // Call the info function + } + lcd.refresh(); + wait(1.0); + if (g_L_flag){ // Condition to change over into new loop g_L_flag = 0; L.fall(&L_isr); @@ -100,22 +110,8 @@ } lcd.refresh(); wait(1.0); - - - if (g_R_flag){ // Condition to change over into new loop - g_R_flag = 0; - R.rise(&R_isr); - serial.printf(" Information Page Selected "); // Debugging Print - lcd.clear(); // Clear Screen - lcd.printString("Info Page",0,0); // Print Information Screen - lcd.printString("Author:",0,1); - lcd.printString("Louis M",0,2); - lcd.printString("18689006",0,3); - lcd.printString("Version 1.8",0,4); - - } - lcd.refresh(); - wait(1.0); + + } @@ -155,8 +151,19 @@ { g_L_flag = 1; // set flag in ISR } +void info() +{ + serial.printf(" Information Page Selected "); // Debugging Print + lcd.clear(); // Clear Screen + lcd.printString("Info Page",0,0); // Print Information Screen + lcd.printString("Author:",0,1); + lcd.printString("Louis M",0,2); + lcd.printString("18689006",0,3); + lcd.printString("Version 1.8",0,4); + +} /* - void init_PCB() + void init_Menu() { }