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.
demo.cpp@10:b959bb206e6b, 2016-09-13 (annotated)
- Committer:
- CaptainR
- Date:
- Tue Sep 13 05:53:39 2016 +0000
- Revision:
- 10:b959bb206e6b
- Parent:
- 9:32eb75c01e9d
- Child:
- 11:3ebd2263f3e9
drawElipse, drawFilledElipse, drawTextButton, drawPanel, DrawSlider, ScreenCopyPaste, BevelShadow
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
CaptainR | 0:a5ef6bc3c2e8 | 1 | |
CaptainR | 0:a5ef6bc3c2e8 | 2 | #include "mbed.h" |
CaptainR | 0:a5ef6bc3c2e8 | 3 | #include "Picaso_4DGL-32PTU.h" |
CaptainR | 0:a5ef6bc3c2e8 | 4 | |
CaptainR | 0:a5ef6bc3c2e8 | 5 | #define SHORT_WAIT 500 |
CaptainR | 0:a5ef6bc3c2e8 | 6 | #define LONG_WAIT 2000 |
CaptainR | 0:a5ef6bc3c2e8 | 7 | |
CaptainR | 0:a5ef6bc3c2e8 | 8 | //************************************************************************** |
CaptainR | 0:a5ef6bc3c2e8 | 9 | // Demo program that goes through graphics based functions |
CaptainR | 0:a5ef6bc3c2e8 | 10 | //************************************************************************** |
CaptainR | 3:dcfbceb81fef | 11 | void PICASO_4DGL :: graphicsDemo() { |
CaptainR | 0:a5ef6bc3c2e8 | 12 | |
CaptainR | 6:a1a85f2bc04b | 13 | //cls(); |
CaptainR | 2:81eaaa491a02 | 14 | screenOrientation(landscape); // set orientation to landscape |
CaptainR | 0:a5ef6bc3c2e8 | 15 | puts("This is the Graphics functions demo"); |
CaptainR | 0:a5ef6bc3c2e8 | 16 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 17 | cls(); |
CaptainR | 7:f064ae670553 | 18 | /* |
CaptainR | 0:a5ef6bc3c2e8 | 19 | puts("\nLets change all the "); |
CaptainR | 2:81eaaa491a02 | 20 | textFgColor(Purple); |
CaptainR | 0:a5ef6bc3c2e8 | 21 | puts("PURPLE"); |
CaptainR | 2:81eaaa491a02 | 22 | textFgColor(Yellow); |
CaptainR | 0:a5ef6bc3c2e8 | 23 | puts(" bits to yellow"); |
CaptainR | 3:dcfbceb81fef | 24 | textFgColor(Green); // set Color back to green |
CaptainR | 0:a5ef6bc3c2e8 | 25 | wait_ms(LONG_WAIT); |
CaptainR | 2:81eaaa491a02 | 26 | changeColor(Purple, Yellow); |
CaptainR | 0:a5ef6bc3c2e8 | 27 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 28 | cls(); |
CaptainR | 7:f064ae670553 | 29 | */ |
CaptainR | 7:f064ae670553 | 30 | /* |
CaptainR | 0:a5ef6bc3c2e8 | 31 | puts("Lets draw some shapes:"); |
CaptainR | 3:dcfbceb81fef | 32 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 33 | drawCircle(100, 100, 20, Aqua); |
CaptainR | 3:dcfbceb81fef | 34 | wait_ms(SHORT_WAIT); |
CaptainR | 3:dcfbceb81fef | 35 | drawFilledCircle(50, 50, 20, Red); |
CaptainR | 3:dcfbceb81fef | 36 | wait_ms(SHORT_WAIT); |
CaptainR | 3:dcfbceb81fef | 37 | drawLine(20, 20, 100, 30, Blue); |
CaptainR | 3:dcfbceb81fef | 38 | wait_ms(SHORT_WAIT); |
CaptainR | 3:dcfbceb81fef | 39 | drawRectangle(120, 20, 200, 60, Pink); |
CaptainR | 3:dcfbceb81fef | 40 | wait_ms(SHORT_WAIT); |
CaptainR | 3:dcfbceb81fef | 41 | drawFilledRectangle(210, 0, 250, 80, Orange); |
CaptainR | 3:dcfbceb81fef | 42 | wait_ms(SHORT_WAIT); |
CaptainR | 3:dcfbceb81fef | 43 | short xPolyline[3] = {10, 80, 180}; |
CaptainR | 3:dcfbceb81fef | 44 | short yPolyline[3] = {10, 200, 80}; |
CaptainR | 3:dcfbceb81fef | 45 | drawPolyline(3, xPolyline, yPolyline, Green); |
CaptainR | 3:dcfbceb81fef | 46 | wait_ms(SHORT_WAIT); |
CaptainR | 3:dcfbceb81fef | 47 | short xPolygon[5] = {0, 30, 5, 50, 40}; |
CaptainR | 3:dcfbceb81fef | 48 | short yPolygon[5] = {50, 100, 220, 230, 170}; |
CaptainR | 3:dcfbceb81fef | 49 | drawPolygon(5, xPolygon, yPolygon, Grey); |
CaptainR | 3:dcfbceb81fef | 50 | wait_ms(SHORT_WAIT); |
CaptainR | 3:dcfbceb81fef | 51 | short xFilledPolygon[5] = {260, 280, 290, 300, 255}; |
CaptainR | 3:dcfbceb81fef | 52 | short yFilledPolygon[5] = {0, 20, 35, 55, 22}; |
CaptainR | 3:dcfbceb81fef | 53 | drawFilledPolygon(5, xFilledPolygon, yFilledPolygon, White); |
CaptainR | 3:dcfbceb81fef | 54 | wait_ms(SHORT_WAIT); |
CaptainR | 3:dcfbceb81fef | 55 | drawTriangle(70, 130, 90, 150, 110, 120, Cream); |
CaptainR | 3:dcfbceb81fef | 56 | wait_ms(SHORT_WAIT); |
CaptainR | 3:dcfbceb81fef | 57 | drawFilledTriangle(260, 50, 300, 90, 240, 120, Yellow); |
CaptainR | 3:dcfbceb81fef | 58 | wait_ms(SHORT_WAIT); |
CaptainR | 10:b959bb206e6b | 59 | drawElipse(200, 130, 20, 10, Olive); |
CaptainR | 10:b959bb206e6b | 60 | wait_ms(SHORT_WAIT); |
CaptainR | 10:b959bb206e6b | 61 | drawFilledElipse(200, 100, 30, 20, Navy); |
CaptainR | 4:50511ed54ab4 | 62 | cls(); |
CaptainR | 7:f064ae670553 | 63 | */ |
CaptainR | 6:a1a85f2bc04b | 64 | /* |
CaptainR | 6:a1a85f2bc04b | 65 | // somehow after this function display stops (but the calculation is right) |
CaptainR | 4:50511ed54ab4 | 66 | puts("Lets calculate distance from point 0,0 on angle 40, 60 pixels away:"); |
CaptainR | 4:50511ed54ab4 | 67 | wait_ms(LONG_WAIT); |
CaptainR | 4:50511ed54ab4 | 68 | cls(); |
CaptainR | 4:50511ed54ab4 | 69 | calculateOrbit(40, 60); |
CaptainR | 6:a1a85f2bc04b | 70 | wait_ms(SHORT_WAIT); |
CaptainR | 6:a1a85f2bc04b | 71 | cls(); |
CaptainR | 6:a1a85f2bc04b | 72 | */ |
CaptainR | 8:b634ac9c92f8 | 73 | /* |
CaptainR | 6:a1a85f2bc04b | 74 | puts("Lets draw some pixels:"); |
CaptainR | 6:a1a85f2bc04b | 75 | wait_ms(LONG_WAIT); |
CaptainR | 6:a1a85f2bc04b | 76 | putPixel(15, 15, White); |
CaptainR | 6:a1a85f2bc04b | 77 | wait_ms(SHORT_WAIT); |
CaptainR | 6:a1a85f2bc04b | 78 | putPixel(20, 20, Red); |
CaptainR | 6:a1a85f2bc04b | 79 | wait_ms(SHORT_WAIT); |
CaptainR | 6:a1a85f2bc04b | 80 | putPixel(25, 25, Green); |
CaptainR | 6:a1a85f2bc04b | 81 | wait_ms(SHORT_WAIT); |
CaptainR | 6:a1a85f2bc04b | 82 | putPixel(30, 30, Blue); |
CaptainR | 6:a1a85f2bc04b | 83 | wait_ms(SHORT_WAIT); |
CaptainR | 6:a1a85f2bc04b | 84 | putPixel(35, 35, Aqua); |
CaptainR | 6:a1a85f2bc04b | 85 | wait_ms(LONG_WAIT); |
CaptainR | 6:a1a85f2bc04b | 86 | cls(); |
CaptainR | 8:b634ac9c92f8 | 87 | */ |
CaptainR | 8:b634ac9c92f8 | 88 | /* |
CaptainR | 7:f064ae670553 | 89 | puts("Lets move origin point:"); |
CaptainR | 7:f064ae670553 | 90 | wait_ms(LONG_WAIT); |
CaptainR | 7:f064ae670553 | 91 | moveOrigin(100, 100); |
CaptainR | 7:f064ae670553 | 92 | puts("This is the new origin!"); |
CaptainR | 8:b634ac9c92f8 | 93 | wait_ms(LONG_WAIT); |
CaptainR | 8:b634ac9c92f8 | 94 | cls(); |
CaptainR | 8:b634ac9c92f8 | 95 | */ |
CaptainR | 9:32eb75c01e9d | 96 | /* |
CaptainR | 8:b634ac9c92f8 | 97 | puts("Now draw line from here:"); |
CaptainR | 8:b634ac9c92f8 | 98 | wait_ms(SHORT_WAIT); |
CaptainR | 8:b634ac9c92f8 | 99 | lineTo(100, 100); |
CaptainR | 8:b634ac9c92f8 | 100 | wait_ms(SHORT_WAIT); |
CaptainR | 8:b634ac9c92f8 | 101 | puts("To here!"); |
CaptainR | 8:b634ac9c92f8 | 102 | wait_ms(LONG_WAIT); |
CaptainR | 9:32eb75c01e9d | 103 | cls(); |
CaptainR | 9:32eb75c01e9d | 104 | */ |
CaptainR | 10:b959bb206e6b | 105 | /* |
CaptainR | 9:32eb75c01e9d | 106 | puts("Change clipping window, to test it, we use changeColor function, that works only in clipping area:"); |
CaptainR | 9:32eb75c01e9d | 107 | wait_ms(LONG_WAIT); |
CaptainR | 9:32eb75c01e9d | 108 | setClipWindow(0, 0, 200, 20); |
CaptainR | 9:32eb75c01e9d | 109 | changeColor(Green, Red); |
CaptainR | 9:32eb75c01e9d | 110 | puts("\n\n\rDone!!!!"); |
CaptainR | 9:32eb75c01e9d | 111 | wait_ms(LONG_WAIT); |
CaptainR | 9:32eb75c01e9d | 112 | puts("\n\n\rNow extend to here!"); |
CaptainR | 9:32eb75c01e9d | 113 | wait_ms(SHORT_WAIT); |
CaptainR | 9:32eb75c01e9d | 114 | extendClipRegion(); |
CaptainR | 9:32eb75c01e9d | 115 | changeColor(Green, Red); |
CaptainR | 9:32eb75c01e9d | 116 | puts("\n\n\rHow does it look?"); |
CaptainR | 9:32eb75c01e9d | 117 | wait_ms(LONG_WAIT); |
CaptainR | 10:b959bb206e6b | 118 | cls(); |
CaptainR | 10:b959bb206e6b | 119 | */ |
CaptainR | 10:b959bb206e6b | 120 | |
CaptainR | 10:b959bb206e6b | 121 | puts("\nLets place a button:"); |
CaptainR | 10:b959bb206e6b | 122 | wait_ms(LONG_WAIT); |
CaptainR | 10:b959bb206e6b | 123 | cls(); |
CaptainR | 10:b959bb206e6b | 124 | drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); |
CaptainR | 10:b959bb206e6b | 125 | puts("\n\n\n\nDid it work?"); |
CaptainR | 10:b959bb206e6b | 126 | wait_ms(LONG_WAIT); |
CaptainR | 10:b959bb206e6b | 127 | puts("\nNow lets change bevel shadow level"); |
CaptainR | 10:b959bb206e6b | 128 | wait_ms(LONG_WAIT); |
CaptainR | 10:b959bb206e6b | 129 | bevelShadow(0); |
CaptainR | 10:b959bb206e6b | 130 | puts("\nNo shadow"); |
CaptainR | 10:b959bb206e6b | 131 | drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); |
CaptainR | 10:b959bb206e6b | 132 | wait_ms(SHORT_WAIT); |
CaptainR | 10:b959bb206e6b | 133 | bevelShadow(1); |
CaptainR | 10:b959bb206e6b | 134 | puts("\nShadow 1"); |
CaptainR | 10:b959bb206e6b | 135 | drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); |
CaptainR | 10:b959bb206e6b | 136 | wait_ms(SHORT_WAIT); |
CaptainR | 10:b959bb206e6b | 137 | bevelShadow(2); |
CaptainR | 10:b959bb206e6b | 138 | puts("\nShadow 2"); |
CaptainR | 10:b959bb206e6b | 139 | drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); |
CaptainR | 10:b959bb206e6b | 140 | wait_ms(SHORT_WAIT); |
CaptainR | 10:b959bb206e6b | 141 | bevelShadow(3); |
CaptainR | 10:b959bb206e6b | 142 | puts("\nShadow 3"); |
CaptainR | 10:b959bb206e6b | 143 | drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); |
CaptainR | 10:b959bb206e6b | 144 | wait_ms(SHORT_WAIT); |
CaptainR | 10:b959bb206e6b | 145 | bevelShadow(4); |
CaptainR | 10:b959bb206e6b | 146 | puts("\nShadow 4"); |
CaptainR | 10:b959bb206e6b | 147 | drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); |
CaptainR | 10:b959bb206e6b | 148 | wait_ms(SHORT_WAIT); |
CaptainR | 10:b959bb206e6b | 149 | bevelShadow(1); |
CaptainR | 10:b959bb206e6b | 150 | puts("\nShadow 1"); |
CaptainR | 10:b959bb206e6b | 151 | drawButton(DEPRESSED, 100, 200, Aqua, Violet, 2, 2, 2, "Press Me"); |
CaptainR | 10:b959bb206e6b | 152 | |
CaptainR | 8:b634ac9c92f8 | 153 | //cls(); |
CaptainR | 9:32eb75c01e9d | 154 | |
CaptainR | 10:b959bb206e6b | 155 | /* |
CaptainR | 10:b959bb206e6b | 156 | puts("\nLets place a panel:"); |
CaptainR | 10:b959bb206e6b | 157 | wait_ms(LONG_WAIT); |
CaptainR | 10:b959bb206e6b | 158 | cls(); |
CaptainR | 10:b959bb206e6b | 159 | drawPanel(DEPRESSED, 0, 0, 2, 2, Cream); |
CaptainR | 10:b959bb206e6b | 160 | puts("\nDid it work?"); |
CaptainR | 10:b959bb206e6b | 161 | wait_ms(LONG_WAIT); |
CaptainR | 10:b959bb206e6b | 162 | cls(); |
CaptainR | 10:b959bb206e6b | 163 | */ |
CaptainR | 10:b959bb206e6b | 164 | /* |
CaptainR | 10:b959bb206e6b | 165 | puts("\nLets place a slider:"); |
CaptainR | 10:b959bb206e6b | 166 | wait_ms(LONG_WAIT); |
CaptainR | 10:b959bb206e6b | 167 | cls(); |
CaptainR | 10:b959bb206e6b | 168 | drawSlider(RAISED, 30, 40, 210, 90, Violet, 100, 0); |
CaptainR | 10:b959bb206e6b | 169 | puts("\nDid it work?"); |
CaptainR | 10:b959bb206e6b | 170 | wait_ms(LONG_WAIT); |
CaptainR | 10:b959bb206e6b | 171 | cls(); |
CaptainR | 10:b959bb206e6b | 172 | */ |
CaptainR | 10:b959bb206e6b | 173 | /* |
CaptainR | 10:b959bb206e6b | 174 | puts("\nThis particular function is going to copy a specified portion of the creen and paste it somewhere else!"); |
CaptainR | 10:b959bb206e6b | 175 | wait_ms(LONG_WAIT); |
CaptainR | 10:b959bb206e6b | 176 | wait_ms(LONG_WAIT); |
CaptainR | 10:b959bb206e6b | 177 | //cls(); |
CaptainR | 10:b959bb206e6b | 178 | screenCopyPaste(0, 0, 50, 100, 200, 50); |
CaptainR | 10:b959bb206e6b | 179 | puts("\nDid it work?"); |
CaptainR | 10:b959bb206e6b | 180 | wait_ms(LONG_WAIT); |
CaptainR | 10:b959bb206e6b | 181 | cls(); |
CaptainR | 10:b959bb206e6b | 182 | */ |
CaptainR | 6:a1a85f2bc04b | 183 | |
CaptainR | 0:a5ef6bc3c2e8 | 184 | } |
CaptainR | 0:a5ef6bc3c2e8 | 185 | |
CaptainR | 0:a5ef6bc3c2e8 | 186 | //************************************************************************** |
CaptainR | 0:a5ef6bc3c2e8 | 187 | // Demo program that goes through main functions |
CaptainR | 0:a5ef6bc3c2e8 | 188 | //************************************************************************** |
CaptainR | 3:dcfbceb81fef | 189 | void PICASO_4DGL :: mainDemo() { |
CaptainR | 0:a5ef6bc3c2e8 | 190 | |
CaptainR | 0:a5ef6bc3c2e8 | 191 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 192 | puts("This is the main functions demo"); |
CaptainR | 0:a5ef6bc3c2e8 | 193 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 194 | cls(); |
CaptainR | 2:81eaaa491a02 | 195 | |
CaptainR | 0:a5ef6bc3c2e8 | 196 | puts("\nBaudrates:"); |
CaptainR | 0:a5ef6bc3c2e8 | 197 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 198 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 199 | baudrate(4800); |
CaptainR | 0:a5ef6bc3c2e8 | 200 | puts("\n4800"); |
CaptainR | 0:a5ef6bc3c2e8 | 201 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 202 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 203 | baudrate(9600); |
CaptainR | 0:a5ef6bc3c2e8 | 204 | puts("\n9600"); |
CaptainR | 0:a5ef6bc3c2e8 | 205 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 206 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 207 | baudrate(14400); |
CaptainR | 0:a5ef6bc3c2e8 | 208 | puts("\n14400"); |
CaptainR | 0:a5ef6bc3c2e8 | 209 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 210 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 211 | baudrate(19200); |
CaptainR | 0:a5ef6bc3c2e8 | 212 | puts("\n19200"); |
CaptainR | 0:a5ef6bc3c2e8 | 213 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 214 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 215 | baudrate(38400); |
CaptainR | 0:a5ef6bc3c2e8 | 216 | puts("\n38400"); |
CaptainR | 0:a5ef6bc3c2e8 | 217 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 218 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 219 | baudrate(56000); |
CaptainR | 0:a5ef6bc3c2e8 | 220 | puts("\n56000"); |
CaptainR | 0:a5ef6bc3c2e8 | 221 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 222 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 223 | baudrate(57600); |
CaptainR | 0:a5ef6bc3c2e8 | 224 | puts("\n57600"); |
CaptainR | 0:a5ef6bc3c2e8 | 225 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 226 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 227 | baudrate(115200); |
CaptainR | 0:a5ef6bc3c2e8 | 228 | puts("\n115200"); |
CaptainR | 0:a5ef6bc3c2e8 | 229 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 230 | cls(); |
CaptainR | 2:81eaaa491a02 | 231 | baudrate(128000); |
CaptainR | 2:81eaaa491a02 | 232 | puts("\n128000"); |
CaptainR | 2:81eaaa491a02 | 233 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 234 | cls(); |
CaptainR | 2:81eaaa491a02 | 235 | baudrate(256000); |
CaptainR | 2:81eaaa491a02 | 236 | puts("\n256000"); |
CaptainR | 2:81eaaa491a02 | 237 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 238 | cls(); |
CaptainR | 2:81eaaa491a02 | 239 | baudrate(300000); |
CaptainR | 2:81eaaa491a02 | 240 | puts("\n300000"); |
CaptainR | 2:81eaaa491a02 | 241 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 242 | cls(); |
CaptainR | 2:81eaaa491a02 | 243 | baudrate(375000); |
CaptainR | 2:81eaaa491a02 | 244 | puts("\n375000"); |
CaptainR | 2:81eaaa491a02 | 245 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 246 | cls(); |
CaptainR | 2:81eaaa491a02 | 247 | baudrate(500000); |
CaptainR | 2:81eaaa491a02 | 248 | puts("\n500000"); |
CaptainR | 2:81eaaa491a02 | 249 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 250 | cls(); |
CaptainR | 2:81eaaa491a02 | 251 | baudrate(600000); |
CaptainR | 2:81eaaa491a02 | 252 | puts("\n600000"); |
CaptainR | 2:81eaaa491a02 | 253 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 254 | cls(); |
CaptainR | 3:dcfbceb81fef | 255 | baudrate(115200); |
CaptainR | 3:dcfbceb81fef | 256 | puts("\nSet back to 115200"); |
CaptainR | 0:a5ef6bc3c2e8 | 257 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 258 | cls(); |
CaptainR | 2:81eaaa491a02 | 259 | |
CaptainR | 0:a5ef6bc3c2e8 | 260 | puts("\nOrientation:"); |
CaptainR | 0:a5ef6bc3c2e8 | 261 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 262 | cls(); |
CaptainR | 2:81eaaa491a02 | 263 | screenOrientation(landscape); |
CaptainR | 0:a5ef6bc3c2e8 | 264 | puts("landscape"); |
CaptainR | 0:a5ef6bc3c2e8 | 265 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 266 | cls(); |
CaptainR | 2:81eaaa491a02 | 267 | screenOrientation(landscapeRew); |
CaptainR | 0:a5ef6bc3c2e8 | 268 | puts("landscape rewersed"); |
CaptainR | 0:a5ef6bc3c2e8 | 269 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 270 | cls(); |
CaptainR | 2:81eaaa491a02 | 271 | screenOrientation(portrait); |
CaptainR | 0:a5ef6bc3c2e8 | 272 | puts("portrait"); |
CaptainR | 0:a5ef6bc3c2e8 | 273 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 274 | cls(); |
CaptainR | 2:81eaaa491a02 | 275 | screenOrientation(portraitRew); |
CaptainR | 0:a5ef6bc3c2e8 | 276 | puts("portrait rewersed"); |
CaptainR | 0:a5ef6bc3c2e8 | 277 | wait_ms(LONG_WAIT); |
CaptainR | 2:81eaaa491a02 | 278 | screenOrientation(landscape); // set back screen to landscape |
CaptainR | 0:a5ef6bc3c2e8 | 279 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 280 | |
CaptainR | 0:a5ef6bc3c2e8 | 281 | } |
CaptainR | 0:a5ef6bc3c2e8 | 282 | |
CaptainR | 0:a5ef6bc3c2e8 | 283 | //************************************************************************** |
CaptainR | 0:a5ef6bc3c2e8 | 284 | // Demo program that goes through text based functions |
CaptainR | 0:a5ef6bc3c2e8 | 285 | //************************************************************************** |
CaptainR | 3:dcfbceb81fef | 286 | void PICASO_4DGL :: textDemo() { |
CaptainR | 0:a5ef6bc3c2e8 | 287 | |
CaptainR | 0:a5ef6bc3c2e8 | 288 | cls(); |
CaptainR | 2:81eaaa491a02 | 289 | screenOrientation(landscape); // set screen to landscape |
CaptainR | 0:a5ef6bc3c2e8 | 290 | puts("This is the Text functions demo"); |
CaptainR | 0:a5ef6bc3c2e8 | 291 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 292 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 293 | |
CaptainR | 0:a5ef6bc3c2e8 | 294 | puts("\nText attributes:"); |
CaptainR | 0:a5ef6bc3c2e8 | 295 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 296 | //cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 297 | puts("\n\n"); |
CaptainR | 2:81eaaa491a02 | 298 | textAttributes(bold); |
CaptainR | 0:a5ef6bc3c2e8 | 299 | puts("\nBOLD"); |
CaptainR | 0:a5ef6bc3c2e8 | 300 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 301 | textAttributes(bold + italic); |
CaptainR | 0:a5ef6bc3c2e8 | 302 | puts("\nBOLD & ITALIC"); |
CaptainR | 0:a5ef6bc3c2e8 | 303 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 304 | textAttributes(bold + italic + inverse); |
CaptainR | 0:a5ef6bc3c2e8 | 305 | puts("\nBOLD & ITALIC & INVERSE"); |
CaptainR | 0:a5ef6bc3c2e8 | 306 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 307 | textAttributes(bold + italic + inverse + underline); |
CaptainR | 0:a5ef6bc3c2e8 | 308 | puts("\nBOLD & ITALIC & INVERSE & UNDERLINE"); |
CaptainR | 0:a5ef6bc3c2e8 | 309 | wait_ms(LONG_WAIT); |
CaptainR | 2:81eaaa491a02 | 310 | textAttributes(DISABLE); // set everything back to normal |
CaptainR | 0:a5ef6bc3c2e8 | 311 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 312 | |
CaptainR | 0:a5ef6bc3c2e8 | 313 | puts("\nText modes:"); |
CaptainR | 0:a5ef6bc3c2e8 | 314 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 315 | cls(); |
CaptainR | 2:81eaaa491a02 | 316 | textBold(ENABLE); |
CaptainR | 0:a5ef6bc3c2e8 | 317 | puts("\nBOLD:"); |
CaptainR | 0:a5ef6bc3c2e8 | 318 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 319 | textBold(DISABLE); |
CaptainR | 2:81eaaa491a02 | 320 | textInverse(ENABLE); |
CaptainR | 0:a5ef6bc3c2e8 | 321 | puts("\nINVERSE:"); |
CaptainR | 0:a5ef6bc3c2e8 | 322 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 323 | textInverse(DISABLE); |
CaptainR | 2:81eaaa491a02 | 324 | textItalic(ENABLE); |
CaptainR | 0:a5ef6bc3c2e8 | 325 | puts("\nITALIC:"); |
CaptainR | 0:a5ef6bc3c2e8 | 326 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 327 | textItalic(DISABLE); |
CaptainR | 2:81eaaa491a02 | 328 | textUnderline(ENABLE); |
CaptainR | 0:a5ef6bc3c2e8 | 329 | puts("\nUNDERLINE:"); |
CaptainR | 0:a5ef6bc3c2e8 | 330 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 331 | textUnderline(DISABLE); |
CaptainR | 0:a5ef6bc3c2e8 | 332 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 333 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 334 | |
CaptainR | 0:a5ef6bc3c2e8 | 335 | puts("\nText gaps:"); |
CaptainR | 0:a5ef6bc3c2e8 | 336 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 337 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 338 | if (textXGap(0) == 1) puts("\nX gap: 0"); |
CaptainR | 0:a5ef6bc3c2e8 | 339 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 340 | if (textXGap(1) == 1) puts("\nX gap: 1"); |
CaptainR | 0:a5ef6bc3c2e8 | 341 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 342 | if (textXGap(2) == 1) puts("\nX gap: 2"); |
CaptainR | 0:a5ef6bc3c2e8 | 343 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 344 | if (textXGap(3) == 1) puts("\nX gap: 3"); |
CaptainR | 0:a5ef6bc3c2e8 | 345 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 346 | if (textXGap(4) == 1) puts("\nX gap: 4"); |
CaptainR | 0:a5ef6bc3c2e8 | 347 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 348 | if (textXGap(5) == 1) puts("\nX gap: 5"); |
CaptainR | 0:a5ef6bc3c2e8 | 349 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 350 | if (textXGap(6) == 1) puts("\nX gap: 6"); |
CaptainR | 0:a5ef6bc3c2e8 | 351 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 352 | puts("\n"); |
CaptainR | 0:a5ef6bc3c2e8 | 353 | textXGap(0); |
CaptainR | 0:a5ef6bc3c2e8 | 354 | if (textYGap(0) == 1) puts("\nY gap: 0"); |
CaptainR | 0:a5ef6bc3c2e8 | 355 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 356 | if (textYGap(1) == 1) puts("\nY gap: 1"); |
CaptainR | 0:a5ef6bc3c2e8 | 357 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 358 | if (textYGap(2) == 1) puts("\nY gap: 2"); |
CaptainR | 0:a5ef6bc3c2e8 | 359 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 360 | if (textYGap(3) == 1) puts("\nY gap: 3"); |
CaptainR | 0:a5ef6bc3c2e8 | 361 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 362 | if (textYGap(4) == 1) puts("\nY gap: 4"); |
CaptainR | 0:a5ef6bc3c2e8 | 363 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 364 | if (textYGap(5) == 1) puts("\nY gap: 5"); |
CaptainR | 0:a5ef6bc3c2e8 | 365 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 366 | if (textYGap(6) == 1) puts("\nY gap: 6"); |
CaptainR | 0:a5ef6bc3c2e8 | 367 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 368 | textYGap(0); |
CaptainR | 0:a5ef6bc3c2e8 | 369 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 370 | |
CaptainR | 0:a5ef6bc3c2e8 | 371 | puts("Text width:"); |
CaptainR | 0:a5ef6bc3c2e8 | 372 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 373 | if (textWidth(1) == 1) puts("\nWidth: 1"); |
CaptainR | 0:a5ef6bc3c2e8 | 374 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 375 | if (textWidth(2) == 1) puts("\nWidth: 2"); |
CaptainR | 0:a5ef6bc3c2e8 | 376 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 377 | if (textWidth(3) == 1) puts("\nWidth: 3"); |
CaptainR | 0:a5ef6bc3c2e8 | 378 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 379 | if (textWidth(4) == 1) puts("\nWidth: 4"); |
CaptainR | 0:a5ef6bc3c2e8 | 380 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 381 | textWidth(1); |
CaptainR | 0:a5ef6bc3c2e8 | 382 | puts("\nText height:"); |
CaptainR | 0:a5ef6bc3c2e8 | 383 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 384 | //cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 385 | if (textHeight(1) == 1) puts("\nHeight: 1"); |
CaptainR | 0:a5ef6bc3c2e8 | 386 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 387 | if (textHeight(2) == 1) puts("\nHeight: 2"); |
CaptainR | 0:a5ef6bc3c2e8 | 388 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 389 | if (textHeight(3) == 1) puts("\nHeight: 3"); |
CaptainR | 0:a5ef6bc3c2e8 | 390 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 391 | if (textHeight(4) == 1) puts("\nHeight: 4"); |
CaptainR | 0:a5ef6bc3c2e8 | 392 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 393 | textHeight(1); |
CaptainR | 0:a5ef6bc3c2e8 | 394 | cls(); |
CaptainR | 2:81eaaa491a02 | 395 | |
CaptainR | 0:a5ef6bc3c2e8 | 396 | puts("Fonts:"); |
CaptainR | 0:a5ef6bc3c2e8 | 397 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 398 | cls(); |
CaptainR | 2:81eaaa491a02 | 399 | setFont(font1); |
CaptainR | 0:a5ef6bc3c2e8 | 400 | puts("\nThis is Font 1"); |
CaptainR | 0:a5ef6bc3c2e8 | 401 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 402 | setFont(font2); |
CaptainR | 0:a5ef6bc3c2e8 | 403 | puts("\nThis is Font 2"); |
CaptainR | 0:a5ef6bc3c2e8 | 404 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 405 | setFont(font3); |
CaptainR | 0:a5ef6bc3c2e8 | 406 | puts("\nThis is Font 3"); |
CaptainR | 0:a5ef6bc3c2e8 | 407 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 408 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 409 | |
CaptainR | 2:81eaaa491a02 | 410 | |
CaptainR | 2:81eaaa491a02 | 411 | screenOrientation(portrait); |
CaptainR | 0:a5ef6bc3c2e8 | 412 | puts("\nText Background colors:"); |
CaptainR | 0:a5ef6bc3c2e8 | 413 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 414 | cls(); |
CaptainR | 2:81eaaa491a02 | 415 | textBgColor(Black); |
CaptainR | 3:dcfbceb81fef | 416 | puts("\nBG Color = BLACK"); |
CaptainR | 0:a5ef6bc3c2e8 | 417 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 418 | textBgColor(Navy); |
CaptainR | 3:dcfbceb81fef | 419 | puts("\nBG Color = NAVY"); |
CaptainR | 0:a5ef6bc3c2e8 | 420 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 421 | textFgColor(Black); |
CaptainR | 2:81eaaa491a02 | 422 | textBgColor(DGreen); |
CaptainR | 3:dcfbceb81fef | 423 | puts("\nBG Color = DARK GREEN"); |
CaptainR | 0:a5ef6bc3c2e8 | 424 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 425 | textBgColor(DCyan); |
CaptainR | 3:dcfbceb81fef | 426 | puts("\nBG Color = DARK CYAN"); |
CaptainR | 0:a5ef6bc3c2e8 | 427 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 428 | textBgColor(Purple); |
CaptainR | 3:dcfbceb81fef | 429 | puts("\nBG Color = PURPLE"); |
CaptainR | 0:a5ef6bc3c2e8 | 430 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 431 | textBgColor(Olive); |
CaptainR | 3:dcfbceb81fef | 432 | puts("\nBG Color = OLIVE"); |
CaptainR | 0:a5ef6bc3c2e8 | 433 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 434 | textBgColor(Grey); |
CaptainR | 3:dcfbceb81fef | 435 | puts("\nBG Color = GREY"); |
CaptainR | 0:a5ef6bc3c2e8 | 436 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 437 | textBgColor(Blue); |
CaptainR | 3:dcfbceb81fef | 438 | puts("\nBG Color = BLUE"); |
CaptainR | 0:a5ef6bc3c2e8 | 439 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 440 | textBgColor(Green); |
CaptainR | 3:dcfbceb81fef | 441 | puts("\nBG Color = GREEN"); |
CaptainR | 0:a5ef6bc3c2e8 | 442 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 443 | textBgColor(Red); |
CaptainR | 3:dcfbceb81fef | 444 | puts("\nBG Color = RED"); |
CaptainR | 0:a5ef6bc3c2e8 | 445 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 446 | textBgColor(Yellow); |
CaptainR | 3:dcfbceb81fef | 447 | puts("\nBG Color = YELLOW"); |
CaptainR | 0:a5ef6bc3c2e8 | 448 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 449 | textBgColor(GYellow); |
CaptainR | 3:dcfbceb81fef | 450 | puts("\nBG Color = GREEN YELLOW"); |
CaptainR | 0:a5ef6bc3c2e8 | 451 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 452 | textBgColor(White); |
CaptainR | 3:dcfbceb81fef | 453 | puts("\nBG Color = WHITE"); |
CaptainR | 0:a5ef6bc3c2e8 | 454 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 455 | textBgColor(Orange); |
CaptainR | 3:dcfbceb81fef | 456 | puts("\nBG Color = ORANGE"); |
CaptainR | 0:a5ef6bc3c2e8 | 457 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 458 | textBgColor(Pink); |
CaptainR | 3:dcfbceb81fef | 459 | puts("\nBG Color = PINK"); |
CaptainR | 0:a5ef6bc3c2e8 | 460 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 461 | textBgColor(Violet); |
CaptainR | 3:dcfbceb81fef | 462 | puts("\nBG Color = VIOLET"); |
CaptainR | 0:a5ef6bc3c2e8 | 463 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 464 | textBgColor(Aqua); |
CaptainR | 3:dcfbceb81fef | 465 | puts("\nBG Color = AQUA"); |
CaptainR | 0:a5ef6bc3c2e8 | 466 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 467 | textBgColor(Cream); |
CaptainR | 3:dcfbceb81fef | 468 | puts("\nBG Color = CREAM"); |
CaptainR | 0:a5ef6bc3c2e8 | 469 | wait_ms(LONG_WAIT); |
CaptainR | 3:dcfbceb81fef | 470 | textBgColor(Black); // set Color back |
CaptainR | 3:dcfbceb81fef | 471 | textFgColor(Green); // set Color back |
CaptainR | 0:a5ef6bc3c2e8 | 472 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 473 | |
CaptainR | 0:a5ef6bc3c2e8 | 474 | puts("Lets try moving cursor..."); |
CaptainR | 0:a5ef6bc3c2e8 | 475 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 476 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 477 | if (moveCursor(5, 5) == 1) puts("+"); |
CaptainR | 0:a5ef6bc3c2e8 | 478 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 479 | if (moveCursor(10, 10) == 1) puts("+"); |
CaptainR | 0:a5ef6bc3c2e8 | 480 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 481 | screenOrientation(4); |
CaptainR | 0:a5ef6bc3c2e8 | 482 | if (moveCursor(50, 50) == 1) puts("+"); |
CaptainR | 0:a5ef6bc3c2e8 | 483 | wait_ms(SHORT_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 484 | if (moveCursor(19, 29) == 1) puts("+"); |
CaptainR | 0:a5ef6bc3c2e8 | 485 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 486 | cls(); |
CaptainR | 0:a5ef6bc3c2e8 | 487 | |
CaptainR | 0:a5ef6bc3c2e8 | 488 | |
CaptainR | 2:81eaaa491a02 | 489 | screenOrientation(portrait); |
CaptainR | 3:dcfbceb81fef | 490 | puts("\nText Foreground Colors:"); |
CaptainR | 0:a5ef6bc3c2e8 | 491 | wait_ms(LONG_WAIT); |
CaptainR | 0:a5ef6bc3c2e8 | 492 | cls(); |
CaptainR | 2:81eaaa491a02 | 493 | textBgColor(White); |
CaptainR | 2:81eaaa491a02 | 494 | textFgColor(Black); |
CaptainR | 3:dcfbceb81fef | 495 | puts("\nFG Color = BLACK"); |
CaptainR | 2:81eaaa491a02 | 496 | textBgColor(Black); |
CaptainR | 0:a5ef6bc3c2e8 | 497 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 498 | textFgColor(Navy); |
CaptainR | 3:dcfbceb81fef | 499 | puts("\nFG Color = NAVY"); |
CaptainR | 0:a5ef6bc3c2e8 | 500 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 501 | textFgColor(DGreen); |
CaptainR | 3:dcfbceb81fef | 502 | puts("\nFG Color = DARK GREEN"); |
CaptainR | 0:a5ef6bc3c2e8 | 503 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 504 | textFgColor(DCyan); |
CaptainR | 3:dcfbceb81fef | 505 | puts("\nFG Color = DARK CYAN"); |
CaptainR | 0:a5ef6bc3c2e8 | 506 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 507 | textFgColor(Purple); |
CaptainR | 3:dcfbceb81fef | 508 | puts("\nFG Color = PURPLE"); |
CaptainR | 0:a5ef6bc3c2e8 | 509 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 510 | textFgColor(Olive); |
CaptainR | 3:dcfbceb81fef | 511 | puts("\nFG Color = OLIVE"); |
CaptainR | 0:a5ef6bc3c2e8 | 512 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 513 | textFgColor(Grey); |
CaptainR | 3:dcfbceb81fef | 514 | puts("\nFG Color = GREY"); |
CaptainR | 0:a5ef6bc3c2e8 | 515 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 516 | textFgColor(Blue); |
CaptainR | 3:dcfbceb81fef | 517 | puts("\nFG Color = BLUE"); |
CaptainR | 0:a5ef6bc3c2e8 | 518 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 519 | textFgColor(Green); |
CaptainR | 3:dcfbceb81fef | 520 | puts("\nFG Color = GREEN"); |
CaptainR | 0:a5ef6bc3c2e8 | 521 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 522 | textFgColor(Red); |
CaptainR | 3:dcfbceb81fef | 523 | puts("\nFG Color = RED"); |
CaptainR | 0:a5ef6bc3c2e8 | 524 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 525 | textFgColor(Yellow); |
CaptainR | 3:dcfbceb81fef | 526 | puts("\nFG Color = YELLOW"); |
CaptainR | 0:a5ef6bc3c2e8 | 527 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 528 | textFgColor(GYellow); |
CaptainR | 3:dcfbceb81fef | 529 | puts("\nFG Color = GREEN YELLOW"); |
CaptainR | 0:a5ef6bc3c2e8 | 530 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 531 | textFgColor(White); |
CaptainR | 3:dcfbceb81fef | 532 | puts("\nFG Color = WHITE"); |
CaptainR | 0:a5ef6bc3c2e8 | 533 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 534 | textFgColor(Orange); |
CaptainR | 3:dcfbceb81fef | 535 | puts("\nFG Color = ORANGE"); |
CaptainR | 0:a5ef6bc3c2e8 | 536 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 537 | textFgColor(Pink); |
CaptainR | 3:dcfbceb81fef | 538 | puts("\nFG Color = PINK"); |
CaptainR | 0:a5ef6bc3c2e8 | 539 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 540 | textFgColor(Violet); |
CaptainR | 3:dcfbceb81fef | 541 | puts("\nFG Color = VIOLET"); |
CaptainR | 0:a5ef6bc3c2e8 | 542 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 543 | textFgColor(Aqua); |
CaptainR | 3:dcfbceb81fef | 544 | puts("\nFG Color = AQUA"); |
CaptainR | 0:a5ef6bc3c2e8 | 545 | wait_ms(SHORT_WAIT); |
CaptainR | 2:81eaaa491a02 | 546 | textFgColor(Cream); |
CaptainR | 3:dcfbceb81fef | 547 | puts("\nFG Color = CREAM"); |
CaptainR | 2:81eaaa491a02 | 548 | wait_ms(LONG_WAIT); |
CaptainR | 3:dcfbceb81fef | 549 | textFgColor(Green); // set Color back |
CaptainR | 2:81eaaa491a02 | 550 | |
CaptainR | 2:81eaaa491a02 | 551 | |
CaptainR | 0:a5ef6bc3c2e8 | 552 | } |