Praktikum1_7_AMSL

Dependencies:   C12832_lcd mbed

main.cpp

Committer:
slueke
Date:
2018-03-07
Revision:
0:9419a34f07b4

File content as of revision 0:9419a34f07b4:

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

// LCD and Joystick Setting
C12832_LCD lcd;

BusIn Up(p15);
BusIn Down(p12);
BusIn Left(p13);
BusIn Right(p16);
BusOut Reset(p14);

unsigned short poti =0;

// Custom Function 
void initialize();
void LCD_Anzeige();

AnalogIn input(p19);

// Main 
int main()
{
    initialize(); 
    while(1) 
    {
        
        poti= input.read_u16();
        LCD_Anzeige();     
        wait(0.1);                                              
    }
}
void initialize()
{
    lcd.cls();
    lcd.locate(0,0);
    lcd.printf("Hallo Bielefeld!");     
}

        
void LCD_Anzeige(){
     lcd.cls();
     lcd.locate(0,0);
     lcd.printf("Hallo Bielefeld!");   
     lcd.locate(0,15);   // Set Location print a text    
        // Operations by Joystic
     lcd.printf("%u",poti);       
    
    }