![](/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:
- 15:73383333229d
- Parent:
- 14:fa5f83f26ed7
- Child:
- 23:655780ba2686
diff -r fa5f83f26ed7 -r 73383333229d main.cpp --- a/main.cpp Sun Jan 16 17:29:18 2022 +0000 +++ b/main.cpp Fri Jan 21 14:37:17 2022 +0000 @@ -35,6 +35,14 @@ DigitalOut GRN_led(LED_GREEN); DigitalOut BLU_led(LED_BLUE); +//DigitalOut Grn1(PTA1); +//DigitalOut Grn2(PTA2); +//DigitalOut Grn3(PTC2); + +//DigitalOut Red1(PTD3); +//DigitalOut Red2(PTC4); +//DigitalOut Red3(PTC3); + InterruptIn sw2(SW2); // On-board K64F Switches InterruptIn sw3(SW3); InterruptIn R(PTB3); // Right Bumper Button @@ -69,9 +77,7 @@ tmp102.init(); // Initialise Temp Sensor lcd.init(); // Initialise LCD Joystick.init(); - - - + lcd.setContrast(0.4); // Setup the contrast for the LCD Screen R.fall(&R_isr); R.mode(PullDown); @@ -86,10 +92,6 @@ Y.mode(PullDown); while (1) { - //timer.start(); - //for(i = 0; i < 10; i++){ - // read temperature and print over serial port - MenuNav(); // Call the info function Page1(); @@ -173,8 +175,8 @@ serial.printf(" Page 2 "); // Debugging Print lcd.clear(); // Clear Screen lcd.printString("< Page 2 ",0,0); // Print Information Screen - lcd.printString("Blood Pressure",0,1); - lcd.printString("Logging",0,2); + lcd.printString("Outside Air Mode",0,1); + lcd.printString("=",0,2); lcd.printString("Press A",0,3); lcd.refresh(); @@ -190,11 +192,6 @@ lcd.printString("Temperature",0,0); // Can also pre-determine the co-ordinates of the ',0,0' (must be less than 84 pixels to fit on display) char buffer[14]; // each character is 6 pixels wide, screen is 84 pixels (84/6 = 14 Max amound of Characters) Direction d = Joystick.get_direction(); - float B = 0; - if (1){ - float BP = d + 1; - serial.printf("BP = i%",BP); - } // Therefor strings csn not exceed the 14 Character Limit int length = sprintf(buffer,"T=%.2F 'C",T); // print the temperature from the float variable T if (length <= 14) // Ensuring string will fit on the screen (Printing at x=0) @@ -206,19 +203,25 @@ lcd.printString(buffer,0,2); // display on screen serial.printf(" SP = %f", Set); // lcd.refresh(); - wait(1); + wait(10); if (Set < T){ // Condition to change over into new loop lcd.clear(); // clearing the LCD buffer at the begining of the loop lcd.printString("Over Heating",3,2); // Print New Message serial.printf("OverTemp"); // Debugging Print lcd.refresh(); - wait(1); + if (g_Y_flag){ // Condition to change over into new loop + g_Y_flag = 0; // When the R Flag has been pressed + Y.rise(&Y_isr); + serial.printf("Y Pressed"); + //Page1(); + wait(3); } -} +} +} void MenuNav() { - lcd.clear(); + lcd.clear(); lcd.refresh(); int select = 0; @@ -314,7 +317,7 @@ } } } - +//} void Menu() { if (g_R_flag){ // Condition to change over into new loop @@ -330,12 +333,3 @@ wait(1); } } -/*void BP() -{ - Direction d = Joystick.get_direction(); - float BP = 0; - if (d = 1){ - BP + 1; - serial.printf("BP = i%",BP); - } - */ \ No newline at end of file