fuck this
Dependencies: BMP280
DriverLCD.h
00001 #ifndef __DriverLCD__ 00002 #define __DriverLCD__ 00003 00004 #include "mbed.h" 00005 00006 /* 00007 * This module handles the low level control of a 16x2 LCD. 00008 * It contains a class structure, and allows for text to be written to the LCD. 00009 * Text can be written by using printf, achived by including virtual Stream. 00010 */ 00011 00012 //Datasheet sparkfun.com/datasheets/LCD/HD44780.pdf 00013 00014 #define CMD 0 00015 #define STR 1 00016 #define INIT 2 00017 00018 class DriverLCD : public Stream 00019 { 00020 public: 00021 00022 DriverLCD(PinName rs, PinName e, PinName d4, PinName d5, PinName d6, PinName d7); 00023 //Constructor 00024 00025 void locate(int column, int row); 00026 //Moves cursor to specific position 00027 00028 void cls(); 00029 //Clear LCD 00030 00031 protected: 00032 00033 // Stream implementation functions 00034 virtual int _putc(int data); 00035 virtual int _getc(); 00036 00037 void character(int column, int row, int data); 00038 //Writes a char to the display at set coordinates 00039 00040 void LCD_DATA(int data,int command); 00041 //Configure LCD state 00042 00043 00044 DigitalOut _rs, _e; //Write and command pins 00045 BusOut _d; //Data out 00046 00047 int _column; //Internal position store 00048 int _row; 00049 }; 00050 00051 #endif
Generated on Tue Jul 26 2022 07:29:23 by 1.7.2