Team pumpkin pie. Tokai Univ., MicroMouse
Embed:
(wiki syntax)
Show/hide line numbers
i2clcd.hpp
00001 #pragma once 00002 00003 // Configure 00004 #ifndef I2C_LCD_CONFIG 00005 #define I2C_LCD_CONFIG 00006 #define I2C_LCD_CONFIG_ENABLE_PRINTF 00007 //#define I2C_LCD_CONFIG_ENABLE_CONTRAST 00008 #endif 00009 00010 #include <mbed.h> 00011 00012 class LCD { 00013 public: 00014 LCD(PinName sda, PinName scl); 00015 LCD(I2C& i2c); 00016 void reset(); 00017 void clear(); 00018 LCD locate(int c, int r); 00019 LCD home(); 00020 void put(char ch); 00021 void puts(const char *str); 00022 #ifdef I2C_LCD_CONFIG_ENABLE_PRINTF 00023 void printf(const char *fmt, ...); 00024 #endif 00025 #ifdef I2C_LCD_CONFIG_ENABLE_CONTRAST 00026 void contrast(uint8_t contrast); 00027 void resetContrast(); 00028 #endif 00029 00030 private: 00031 I2C _i2c; 00032 00033 void write(char data); 00034 void write_cmd(char data); 00035 };
Generated on Mon Oct 28 2024 09:21:32 by
1.7.2