testgsosg / Mbed 2 deprecated LCD_Temp_Sensor

Dependencies:   TextLCD mbed

main.cpp

Committer:
tobbl2210
Date:
2018-07-06
Revision:
0:912333ebe623

File content as of revision 0:912333ebe623:

#include "mbed.h"
#include "TextLCD.h"

TextLCD lcd(PA_9, PC_7, PB_5, PB_4, PB_10, PA_8); // rs, e, d4-d7  //// wird benötigt fur LCD Display
DigitalIn button(USER_BUTTON);
AnalogIn adc0 (PA_0);
AnalogIn temp (PC_2);

int main()
{



lcd.cls();
lcd.locate(0,0);
           // command mode
wait(0.015); 

float value=0;

float messwert=0;
lcd.locate(0,0);
lcd.printf("Temperatur");

 
while(1) 
{
float valuenew=0;

for(int index=100; index>0; index--)

{ 
    value = temp.read();
    
    
    
    valuenew = valuenew+value;

    
}  
    
       

   
        
      
        messwert= 3.3*valuenew/100*100; // V in Temp
                    
        lcd.locate(0,1);
        lcd.printf("Value %2f ",messwert);
        
         wait(1);
   
    
            
               
    }
    }