/*############################################################# Program Name : ex3_F469NI_LCDCounter_2 Author : Grant Phillips Date Modified : 22/09/2016 Compiler : ARMmbed Tested On : DISCO-F469NI Description : Example program that demonstrates the use of the graphics functions for the DSI TFT LCD. Requirements : * DISCO-F469NI Board Circuit : * NONE ##############################################################*/ #include "mbed.h" #include "LCD_DISCO_F469NI.h" LCD_DISCO_F469NI lcd; //Create a LCD_DISCO_F469NI object int main() { /* Clear the LCD */ lcd.Clear(LCD_COLOR_BLACK); /* Draw line from top left to bottom right */ lcd.SetTextColor(LCD_COLOR_WHITE); lcd.DrawLine(0,0,799,479); /* Draw lines more lines*/ lcd.SetTextColor(LCD_COLOR_BLUE); lcd.DrawHLine(0,0, 100); //from top left to right (horizontal) for 100 pixels lcd.DrawVLine(0,0, 100); //from top left downward (vertical) for 100 pixels /* Draw rectangle and filled rectangle */ lcd.SetTextColor(LCD_COLOR_GREEN); lcd.DrawRect(120,0,40,50); lcd.FillRect(180,0,50,40); /* Draw circle and filled circle */ lcd.SetTextColor(LCD_COLOR_MAGENTA); lcd.DrawCircle(50,200,20); lcd.FillCircle(100,200,20); /* Draw ellipse and filled ellipse */ lcd.SetTextColor(LCD_COLOR_CYAN); lcd.DrawEllipse(50,260,20,30); lcd.FillEllipse(100,260,20,30); /* Draw a single dot (pixel) in the centre of the circles */ lcd.SetTextColor(LCD_COLOR_YELLOW); lcd.DrawLine(50,200,50,200); lcd.DrawLine(100,200,100,200); /* Display a string - see how it overwrites the diagonal line */ lcd.SetFont(&Font24); lcd.SetTextColor(LCD_COLOR_BLUE); lcd.SetBackColor(LCD_COLOR_BLACK); lcd.DisplayStringAtLine(5, (uint8_t*)"SHAPES"); /* Draw a rectangle to show how it overwrites the string */ lcd.SetTextColor(LCD_COLOR_RED); lcd.DrawRect(40,110,20,20); /* Display a character at position x=150, y=100 */ lcd.DisplayChar(150,100,'A'); /* Display a string at position x=40, y=140 - can use exact pixel position */ lcd.DisplayStringAt(40, 140, (uint8_t*)"ABC", LEFT_MODE); while(1) { //do nothing } }