Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: demo.cpp
- Revision:
- 3:dcfbceb81fef
- Parent:
- 2:81eaaa491a02
- Child:
- 4:50511ed54ab4
--- a/demo.cpp Fri Sep 09 06:17:05 2016 +0000 +++ b/demo.cpp Fri Sep 09 10:19:54 2016 +0000 @@ -8,36 +8,59 @@ //************************************************************************** // Demo program that goes through graphics based functions //************************************************************************** -void TFT_4DGL :: graphicsDemo() { +void PICASO_4DGL :: graphicsDemo() { cls(); screenOrientation(landscape); // set orientation to landscape puts("This is the Graphics functions demo"); wait_ms(LONG_WAIT); cls(); - +/* puts("\nLets change all the "); textFgColor(Purple); puts("PURPLE"); textFgColor(Yellow); puts(" bits to yellow"); - textFgColor(Green); // set color back to green + textFgColor(Green); // set Color back to green wait_ms(LONG_WAIT); changeColor(Purple, Yellow); wait_ms(LONG_WAIT); cls(); - +*/ puts("Lets draw some shapes:"); - wait_ms(LONG_WAIT); - cls(); + wait_ms(SHORT_WAIT); drawCircle(100, 100, 20, Aqua); - + wait_ms(SHORT_WAIT); + drawFilledCircle(50, 50, 20, Red); + wait_ms(SHORT_WAIT); + drawLine(20, 20, 100, 30, Blue); + wait_ms(SHORT_WAIT); + drawRectangle(120, 20, 200, 60, Pink); + wait_ms(SHORT_WAIT); + drawFilledRectangle(210, 0, 250, 80, Orange); + wait_ms(SHORT_WAIT); + short xPolyline[3] = {10, 80, 180}; + short yPolyline[3] = {10, 200, 80}; + drawPolyline(3, xPolyline, yPolyline, Green); + wait_ms(SHORT_WAIT); + short xPolygon[5] = {0, 30, 5, 50, 40}; + short yPolygon[5] = {50, 100, 220, 230, 170}; + drawPolygon(5, xPolygon, yPolygon, Grey); + wait_ms(SHORT_WAIT); + short xFilledPolygon[5] = {260, 280, 290, 300, 255}; + short yFilledPolygon[5] = {0, 20, 35, 55, 22}; + drawFilledPolygon(5, xFilledPolygon, yFilledPolygon, White); + wait_ms(SHORT_WAIT); + drawTriangle(70, 130, 90, 150, 110, 120, Cream); + wait_ms(SHORT_WAIT); + drawFilledTriangle(260, 50, 300, 90, 240, 120, Yellow); + wait_ms(SHORT_WAIT); } //************************************************************************** // Demo program that goes through main functions //************************************************************************** -void TFT_4DGL :: mainDemo() { +void PICASO_4DGL :: mainDemo() { cls(); puts("This is the main functions demo"); @@ -103,8 +126,8 @@ puts("\n600000"); wait_ms(SHORT_WAIT); cls(); - baudrate(9600); - puts("\nSet back to 9600"); + baudrate(115200); + puts("\nSet back to 115200"); wait_ms(LONG_WAIT); cls(); @@ -134,7 +157,7 @@ //************************************************************************** // Demo program that goes through text based functions //************************************************************************** -void TFT_4DGL :: textDemo() { +void PICASO_4DGL :: textDemo() { cls(); screenOrientation(landscape); // set screen to landscape @@ -264,62 +287,62 @@ wait_ms(LONG_WAIT); cls(); textBgColor(Black); - puts("\nBG color = BLACK"); + puts("\nBG Color = BLACK"); wait_ms(SHORT_WAIT); textBgColor(Navy); - puts("\nBG color = NAVY"); + puts("\nBG Color = NAVY"); wait_ms(SHORT_WAIT); textFgColor(Black); textBgColor(DGreen); - puts("\nBG color = DARK GREEN"); + puts("\nBG Color = DARK GREEN"); wait_ms(SHORT_WAIT); textBgColor(DCyan); - puts("\nBG color = DARK CYAN"); + puts("\nBG Color = DARK CYAN"); wait_ms(SHORT_WAIT); textBgColor(Purple); - puts("\nBG color = PURPLE"); + puts("\nBG Color = PURPLE"); wait_ms(SHORT_WAIT); textBgColor(Olive); - puts("\nBG color = OLIVE"); + puts("\nBG Color = OLIVE"); wait_ms(SHORT_WAIT); textBgColor(Grey); - puts("\nBG color = GREY"); + puts("\nBG Color = GREY"); wait_ms(SHORT_WAIT); textBgColor(Blue); - puts("\nBG color = BLUE"); + puts("\nBG Color = BLUE"); wait_ms(SHORT_WAIT); textBgColor(Green); - puts("\nBG color = GREEN"); + puts("\nBG Color = GREEN"); wait_ms(SHORT_WAIT); textBgColor(Red); - puts("\nBG color = RED"); + puts("\nBG Color = RED"); wait_ms(SHORT_WAIT); textBgColor(Yellow); - puts("\nBG color = YELLOW"); + puts("\nBG Color = YELLOW"); wait_ms(SHORT_WAIT); textBgColor(GYellow); - puts("\nBG color = GREEN YELLOW"); + puts("\nBG Color = GREEN YELLOW"); wait_ms(SHORT_WAIT); textBgColor(White); - puts("\nBG color = WHITE"); + puts("\nBG Color = WHITE"); wait_ms(SHORT_WAIT); textBgColor(Orange); - puts("\nBG color = ORANGE"); + puts("\nBG Color = ORANGE"); wait_ms(SHORT_WAIT); textBgColor(Pink); - puts("\nBG color = PINK"); + puts("\nBG Color = PINK"); wait_ms(SHORT_WAIT); textBgColor(Violet); - puts("\nBG color = VIOLET"); + puts("\nBG Color = VIOLET"); wait_ms(SHORT_WAIT); textBgColor(Aqua); - puts("\nBG color = AQUA"); + puts("\nBG Color = AQUA"); wait_ms(SHORT_WAIT); textBgColor(Cream); - puts("\nBG color = CREAM"); + puts("\nBG Color = CREAM"); wait_ms(LONG_WAIT); - textBgColor(Black); // set color back - textFgColor(Green); // set color back + textBgColor(Black); // set Color back + textFgColor(Green); // set Color back cls(); puts("Lets try moving cursor..."); @@ -338,66 +361,66 @@ screenOrientation(portrait); - puts("\nText Foreground colors:"); + puts("\nText Foreground Colors:"); wait_ms(LONG_WAIT); cls(); textBgColor(White); textFgColor(Black); - puts("\nFG color = BLACK"); + puts("\nFG Color = BLACK"); textBgColor(Black); wait_ms(SHORT_WAIT); textFgColor(Navy); - puts("\nFG color = NAVY"); + puts("\nFG Color = NAVY"); wait_ms(SHORT_WAIT); textFgColor(DGreen); - puts("\nFG color = DARK GREEN"); + puts("\nFG Color = DARK GREEN"); wait_ms(SHORT_WAIT); textFgColor(DCyan); - puts("\nFG color = DARK CYAN"); + puts("\nFG Color = DARK CYAN"); wait_ms(SHORT_WAIT); textFgColor(Purple); - puts("\nFG color = PURPLE"); + puts("\nFG Color = PURPLE"); wait_ms(SHORT_WAIT); textFgColor(Olive); - puts("\nFG color = OLIVE"); + puts("\nFG Color = OLIVE"); wait_ms(SHORT_WAIT); textFgColor(Grey); - puts("\nFG color = GREY"); + puts("\nFG Color = GREY"); wait_ms(SHORT_WAIT); textFgColor(Blue); - puts("\nFG color = BLUE"); + puts("\nFG Color = BLUE"); wait_ms(SHORT_WAIT); textFgColor(Green); - puts("\nFG color = GREEN"); + puts("\nFG Color = GREEN"); wait_ms(SHORT_WAIT); textFgColor(Red); - puts("\nFG color = RED"); + puts("\nFG Color = RED"); wait_ms(SHORT_WAIT); textFgColor(Yellow); - puts("\nFG color = YELLOW"); + puts("\nFG Color = YELLOW"); wait_ms(SHORT_WAIT); textFgColor(GYellow); - puts("\nFG color = GREEN YELLOW"); + puts("\nFG Color = GREEN YELLOW"); wait_ms(SHORT_WAIT); textFgColor(White); - puts("\nFG color = WHITE"); + puts("\nFG Color = WHITE"); wait_ms(SHORT_WAIT); textFgColor(Orange); - puts("\nFG color = ORANGE"); + puts("\nFG Color = ORANGE"); wait_ms(SHORT_WAIT); textFgColor(Pink); - puts("\nFG color = PINK"); + puts("\nFG Color = PINK"); wait_ms(SHORT_WAIT); textFgColor(Violet); - puts("\nFG color = VIOLET"); + puts("\nFG Color = VIOLET"); wait_ms(SHORT_WAIT); textFgColor(Aqua); - puts("\nFG color = AQUA"); + puts("\nFG Color = AQUA"); wait_ms(SHORT_WAIT); textFgColor(Cream); - puts("\nFG color = CREAM"); + puts("\nFG Color = CREAM"); wait_ms(LONG_WAIT); - textFgColor(Green); // set color back + textFgColor(Green); // set Color back } \ No newline at end of file