Example program for Grove RGB LCD display.
Dependencies: Grove_LCD_RGB_Backlight mbed
main.cpp
00001 #include "Grove_LCD_RGB_Backlight.h" 00002 #include "mbed.h" 00003 00004 Grove_LCD_RGB_Backlight rgbLCD(p9, p10); 00005 //I2C i2c(p9, p10); 00006 //Serial pc(USBTX, USBRX); 00007 00008 int main() 00009 { 00010 00011 rgbLCD.setRGB(0xff, 0xff, 0xff); //set the color 00012 rgbLCD.print("Hello World!"); 00013 rgbLCD.locate(0,1); 00014 rgbLCD.print("This is a test"); 00015 wait(5); 00016 int count = 0; 00017 while(1) 00018 { 00019 if (count == 0) 00020 { 00021 rgbLCD.setRGB(0xff, 0x00, 0x00); 00022 } 00023 else if (count == 1) 00024 { 00025 rgbLCD.setRGB(0x00, 0xff, 0x00); 00026 } 00027 else if (count == 2) 00028 { 00029 rgbLCD.setRGB(0x00, 0x00, 0xff); 00030 } 00031 wait(1); 00032 count++; 00033 if(count == 3) 00034 { 00035 count = 0; 00036 } 00037 00038 } 00039 }
Generated on Fri Jul 15 2022 20:30:30 by 1.7.2