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