Updated
Embed:
(wiki syntax)
Show/hide line numbers
LCDdisplay.cpp
00001 #include "LCDdisplay.hpp" 00002 00003 void LCD_display() 00004 { 00005 //Write new data to LCD (not fast!) 00006 bufferLock.lock(); 00007 LCD_tout.attach(LCD_toutISR,TOUT_TIME_DEF); 00008 lcd.cls(); 00009 lcd.printf("T:%3.1fC L:%4.1f%%\nP:%6.2fmBar",buffer[newestIndex].gettemp(), buffer[newestIndex].getlight()*100, buffer[newestIndex].getpress()); 00010 bufferLock.unlock(); 00011 LCD_tout.detach(); 00012 00013 } 00014 00015 void LCD_text(string text) 00016 { 00017 LCD_tout.attach(LCD_toutISR,TOUT_TIME_DEF); 00018 lcd.cls(); 00019 lcd.printf("%s",text); 00020 LCD_tout.detach(); 00021 } 00022 00023 void LCD_sdcardmount(string text, float waittime, DigitalOut LED) 00024 { 00025 LCD_tout.attach(LCD_toutISR,TOUT_TIME_SDMOUNT); 00026 lcd.cls(); 00027 lcd.printf("%s",text); 00028 00029 for(int i=0;i<20;i++) 00030 { 00031 LED = 1; 00032 wait(waittime); 00033 LED = 0; 00034 wait(waittime); 00035 } 00036 00037 LCD_tout.detach(); 00038 } 00039 00040 void LCD_toutISR(void) 00041 { 00042 threadstates |= LCD; 00043 }
Generated on Thu Jul 14 2022 11:32:56 by 1.7.2