MEL_Kings / Mbed 2 deprecated Praktikum1_7

Dependencies:   C12832_lcd mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "C12832_lcd.h"
00003 
00004 // LCD and Joystick Setting
00005 C12832_LCD lcd;
00006 
00007 BusIn Up(p15);
00008 BusIn Down(p12);
00009 BusIn Left(p13);
00010 BusIn Right(p16);
00011 BusOut Reset(p14);
00012 
00013 unsigned short poti =0;
00014 
00015 // Custom Function 
00016 void initialize();
00017 void LCD_Anzeige();
00018 
00019 AnalogIn input(p19);
00020 
00021 // Main 
00022 int main()
00023 {
00024     initialize(); 
00025     while(1) 
00026     {
00027         
00028         poti= input.read_u16();
00029         LCD_Anzeige();     
00030         wait(0.1);                                              
00031     }
00032 }
00033 void initialize()
00034 {
00035     lcd.cls();
00036     lcd.locate(0,0);
00037     lcd.printf("Hallo Bielefeld!");     
00038 }
00039 
00040         
00041 void LCD_Anzeige(){
00042      lcd.cls();
00043      lcd.locate(0,0);
00044      lcd.printf("Hallo Bielefeld!");   
00045      lcd.locate(0,15);   // Set Location print a text    
00046         // Operations by Joystic
00047      lcd.printf("%u",poti);       
00048     
00049     }