Rihards Balass / 4DGL-mbed-32PTU
Committer:
CaptainR
Date:
Thu Sep 15 09:48:59 2016 +0000
Revision:
14:561cb06a2739
Parent:
13:1a0800957412
Child:
15:86bdf382e6f7
write sector

Who changed what in which revision?

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