LCD Baseshield GSOE GSOF

Dependents:   WebserverGSOE_Schnaiter HC05__TI4_RP5_Schnaiter

Committer:
jack1930
Date:
Wed Aug 04 16:18:24 2021 +0000
Revision:
10:6104b8ad248f
Parent:
0:0eebf803661c
Child:
11:e02aaac1b3cf
Doku

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jack1930 10:6104b8ad248f 1 /***Verwendet SoftwareI2C von:
jack1930 0:0eebf803661c 2 * mbed Library to use a software master i2c interface on any GPIO pins
jack1930 0:0eebf803661c 3 * Copyright (c) 2012 Christopher Pepper
jack1930 0:0eebf803661c 4 * Released under the MIT License: http://mbed.org/license/mit
jack1930 10:6104b8ad248f 5 *
jack1930 10:6104b8ad248f 6 * Example:
jack1930 10:6104b8ad248f 7 * @code
jack1930 10:6104b8ad248f 8 * #include "LCD.h"
jack1930 10:6104b8ad248f 9
jack1930 10:6104b8ad248f 10 * lcd myLCD;
jack1930 10:6104b8ad248f 11 * int main() {
jack1930 10:6104b8ad248f 12 * int x=0;
jack1930 10:6104b8ad248f 13 * myLCD.clear();
jack1930 10:6104b8ad248f 14 * myLCD.cursorpos(0);
jack1930 10:6104b8ad248f 15 * myLCD.printf("x=%d",x);
jack1930 10:6104b8ad248f 16 * while(1) {
jack1930 10:6104b8ad248f 17 * }
jack1930 10:6104b8ad248f 18 * }
jack1930 10:6104b8ad248f 19 * @endcode
jack1930 0:0eebf803661c 20 */
jack1930 10:6104b8ad248f 21
jack1930 0:0eebf803661c 22 //Anpassungen in SoftwareI2C.cpp: _frequency_delay = 3;
jack1930 0:0eebf803661c 23
jack1930 0:0eebf803661c 24 #include "mbed.h"
jack1930 10:6104b8ad248f 25 #include "SoftwareI2C.h"
jack1930 10:6104b8ad248f 26
jack1930 0:0eebf803661c 27 class lcd
jack1930 0:0eebf803661c 28 {
jack1930 0:0eebf803661c 29 private:
jack1930 0:0eebf803661c 30 uint8_t Adresse;//=0x3F;
jack1930 0:0eebf803661c 31 //DigitalOut *ok;
jack1930 0:0eebf803661c 32 //DigitalOut *nok;
jack1930 0:0eebf803661c 33 //PortOut *po;
jack1930 0:0eebf803661c 34 //DigitalIn *t;
jack1930 0:0eebf803661c 35 SoftwareI2C *i2c;
jack1930 0:0eebf803661c 36 uint8_t wert;
jack1930 0:0eebf803661c 37 public:
jack1930 10:6104b8ad248f 38 /*** Create LCD Instance
jack1930 10:6104b8ad248f 39 */
jack1930 0:0eebf803661c 40 lcd(void);
jack1930 10:6104b8ad248f 41
jack1930 10:6104b8ad248f 42 /*** löscht das Display
jack1930 10:6104b8ad248f 43 */
jack1930 0:0eebf803661c 44 void clear(void);
jack1930 10:6104b8ad248f 45
jack1930 10:6104b8ad248f 46 /*** Positioniert den Cursor
jack1930 10:6104b8ad248f 47 * @param pos 0.. 0xF 1. Zeile, 0x40..0x4F 2. Zeile
jack1930 10:6104b8ad248f 48 */
jack1930 10:6104b8ad248f 49 void cursorpos(uint8_t pos);
jack1930 10:6104b8ad248f 50
jack1930 10:6104b8ad248f 51 /*** Print formattet
jack1930 10:6104b8ad248f 52 * @param *format Formatstring
jack1930 10:6104b8ad248f 53 * @param ... Variablenliste
jack1930 10:6104b8ad248f 54 */
jack1930 10:6104b8ad248f 55 int printf(const char *format, ...);
jack1930 10:6104b8ad248f 56
jack1930 10:6104b8ad248f 57 private:
jack1930 10:6104b8ad248f 58 void warte(void);
jack1930 0:0eebf803661c 59 void sendeByte(char b,uint8_t rw, uint8_t rs );
jack1930 0:0eebf803661c 60 void sendeNippel(char b,uint8_t rw, uint8_t rs );
jack1930 0:0eebf803661c 61 void init(void);
jack1930 0:0eebf803661c 62
jack1930 0:0eebf803661c 63 };