poti

Dependencies:   C12832_lcd mbed

Temperatur_einlesen.cpp

Committer:
tauchi88
Date:
2016-01-28
Revision:
0:444de0e15eae

File content as of revision 0:444de0e15eae:

#include "mbed.h"
#include "C12832_lcd.h"

//Poti1 und Poti2 extra einlesen ud auf 2 Zeilen am Display ausgeben
//Poti1 hat die höchstmögliche Abtastfrequenz (sampletime)
//Poti2 hat eine sehr niedrige Abtastfrequenz

AnalogIn pot1(p19);
AnalogIn pot2(p20);
C12832_LCD lcd;
Ticker t1, t2;
bool updateLcd = true;


void Pot1()
{
    lcd.locate(0,5);
    lcd.printf("Port 1: %f ",pot1.read());
    }
    
void Pot2()
{
    lcd.locate(0,15);
    lcd.printf("Port 2: %u ",pot2.read_u16());
    }   
    
     
int main() {
    
    lcd.cls();

    t1.attach(&Pot1, 1.00);
    t2.attach(&Pot2, 0.10);
    
    while(1)
    {
        if (updateLcd) 
            updateLcd = false;
        

        

        }
}