mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Implementation of LCD Clear (#781)
* Implementation of LCD Clear * Implementation of LCD Clear * Implementation of LCD Clear * Implementation of LCD Clear
This commit is contained in:
		| @@ -148,6 +148,11 @@ void LCDDisplay::printf(const char *format, ...) { | |||||||
|   if (ret > 0) |   if (ret > 0) | ||||||
|     this->print(0, 0, buffer); |     this->print(0, 0, buffer); | ||||||
| } | } | ||||||
|  | void LCDDisplay::clear() { | ||||||
|  |   // clear display, also sets DDRAM address to 0 (home) | ||||||
|  |   this->command_(LCD_DISPLAY_COMMAND_CLEAR_DISPLAY); | ||||||
|  |   delay(2); | ||||||
|  | } | ||||||
| #ifdef USE_TIME | #ifdef USE_TIME | ||||||
| void LCDDisplay::strftime(uint8_t column, uint8_t row, const char *format, time::ESPTime time) { | void LCDDisplay::strftime(uint8_t column, uint8_t row, const char *format, time::ESPTime time) { | ||||||
|   char buffer[64]; |   char buffer[64]; | ||||||
|   | |||||||
| @@ -23,6 +23,8 @@ class LCDDisplay : public PollingComponent { | |||||||
|   float get_setup_priority() const override; |   float get_setup_priority() const override; | ||||||
|   void update() override; |   void update() override; | ||||||
|   void display(); |   void display(); | ||||||
|  |   //// Clear LCD display | ||||||
|  |   void clear(); | ||||||
|  |  | ||||||
|   /// Print the given text at the specified column and row. |   /// Print the given text at the specified column and row. | ||||||
|   void print(uint8_t column, uint8_t row, const char *str); |   void print(uint8_t column, uint8_t row, const char *str); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user