Engine Variable Advance Timing successfull code implementation

Dependencies:   mbed C12832_lcd

Revision:
1:e86fb31f7e95
Parent:
0:1fe3a53ac109
Child:
2:9ff654aaf923
--- a/main.cpp	Wed Dec 02 12:27:03 2020 +0000
+++ b/main.cpp	Wed Dec 02 12:34:53 2020 +0000
@@ -148,8 +148,7 @@
 
    tdc.rise(&TDC_isr); // Generate Interrupt on each TDC pulse
    
-   lcd.cls();
-   //advance_calculator(rpm); //called for the first time, since rpm is 0, 5 will be assigned to advance angle
+   //ance_calculator(rpm); //called for the first time, since rpm is 0, 5 will be assigned to advance angle
       
     while(1) {
        
@@ -166,6 +165,7 @@
             //your code here to calculate rpm
             rpm = (1/(period*100e-6))*60; //1 period = 1*100us(period counter incrments every 100us, this conversion is needed to get the Hz frequency
             
+            lcd.cls(); //this was moved in the while to refresh the screen at every itteration
             lcd.locate(0,0);
             lcd.printf("Period(T): %4.2d ms", period/10); // display captured data in ms to match the osciloscope reading 
             lcd.locate(0,11);