Jack Hansdampf / LCD_i2c_GSOE_Schnaiter

Dependents:   WebserverGSOE_Schnaiter HC05__TI4_RP5_Schnaiter

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LCD.h Source File

LCD.h

00001 /** Verwendet SoftwareI2C von:
00002  * mbed Library to use a software master i2c interface on any GPIO pins
00003  * Copyright (c) 2012 Christopher Pepper
00004  * Released under the MIT License: http://mbed.org/license/mit
00005  *
00006   * Example:
00007  * @code
00008  * #include "LCD.h"
00009 
00010  * lcd myLCD;
00011  * int main() {  
00012  *     int x=0;
00013  *     myLCD.clear();
00014  *     myLCD.cursorpos(0);
00015  *     myLCD.printf("x=%d",x);
00016  *     while(1)  {
00017  *     }
00018  * }
00019  * @endcode
00020  */
00021 
00022 //Anpassungen in SoftwareI2C.cpp: _frequency_delay = 3;
00023 
00024 #include "mbed.h"
00025 #include "SoftwareI2C.h" 
00026    
00027 class lcd
00028 {   
00029     private:
00030     uint8_t Adresse;//=0x3F;
00031     //DigitalOut *ok;
00032     //DigitalOut *nok;
00033     //PortOut *po;
00034     //DigitalIn *t;
00035     SoftwareI2C *i2c;
00036     uint8_t wert;
00037     public:
00038     /** Create LCD Instance
00039     */
00040     lcd(void);
00041     
00042     /** löscht das Display
00043     */
00044     void clear(void);
00045 
00046     /** Positioniert den Cursor
00047     * @param pos 0.. 0xF 1. Zeile, 0x40..0x4F 2. Zeile
00048     */
00049     void cursorpos(uint8_t pos);
00050 
00051     /** Print formattet
00052     * @param *format Formatstring
00053     * @param ... Variablenliste
00054     */
00055     int printf(const char *format, ...);
00056 
00057 private:
00058     void warte(void);
00059     void sendeByte(char b,uint8_t rw, uint8_t rs );
00060     void sendeNippel(char b,uint8_t rw, uint8_t rs );
00061     void init(void);
00062 
00063 };