Rihards Balass / 4DGL-mbed-32PTU
Committer:
CaptainR
Date:
Mon Sep 26 13:41:22 2016 +0000
Revision:
21:ea68a8a3cea4
Parent:
20:88e137b9ea46
Child:
22:cea582ea74c1
file error not checked yet, because MBED not working properly :)

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