LCD Baseshield GSOE GSOF
Dependents: WebserverGSOE_Schnaiter HC05__TI4_RP5_Schnaiter
Diff: LCD.h
- Revision:
- 10:6104b8ad248f
- Parent:
- 0:0eebf803661c
- Child:
- 11:e02aaac1b3cf
--- a/LCD.h Fri Mar 12 09:14:20 2021 +0000 +++ b/LCD.h Wed Aug 04 16:18:24 2021 +0000 @@ -1,13 +1,29 @@ -//Verwendet SoftwareI2C von: -/* +/***Verwendet SoftwareI2C von: * mbed Library to use a software master i2c interface on any GPIO pins * Copyright (c) 2012 Christopher Pepper * Released under the MIT License: http://mbed.org/license/mit + * + * Example: + * @code + * #include "LCD.h" + + * lcd myLCD; + * int main() { + * int x=0; + * myLCD.clear(); + * myLCD.cursorpos(0); + * myLCD.printf("x=%d",x); + * while(1) { + * } + * } + * @endcode */ + //Anpassungen in SoftwareI2C.cpp: _frequency_delay = 3; #include "mbed.h" -#include "SoftwareI2C.h" +#include "SoftwareI2C.h" + class lcd { private: @@ -19,14 +35,29 @@ SoftwareI2C *i2c; uint8_t wert; public: + /*** Create LCD Instance + */ lcd(void); + + /*** löscht das Display + */ void clear(void); + + /*** Positioniert den Cursor + * @param pos 0.. 0xF 1. Zeile, 0x40..0x4F 2. Zeile + */ + void cursorpos(uint8_t pos); + + /*** Print formattet + * @param *format Formatstring + * @param ... Variablenliste + */ + int printf(const char *format, ...); + +private: + void warte(void); void sendeByte(char b,uint8_t rw, uint8_t rs ); void sendeNippel(char b,uint8_t rw, uint8_t rs ); void init(void); - void cursorpos(uint8_t pos); - void warte(void); - int printf(const char *format, ...); - };