an mbed tile music game using a capacitive touchpad and uLCD

Dependencies:   SDFileSystem mbed wave_player

Committer:
clu67
Date:
Mon Mar 14 00:26:24 2016 +0000
Revision:
0:a1c374b9a4fe
Initial Release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
clu67 0:a1c374b9a4fe 1 //
clu67 0:a1c374b9a4fe 2 // uLCD_4DGL is a class to drive 4D Systems LCD screens
clu67 0:a1c374b9a4fe 3 //
clu67 0:a1c374b9a4fe 4 // Copyright (C) <2010> Stephane ROCHON <stephane.rochon at free.fr>
clu67 0:a1c374b9a4fe 5 // Modifed for Goldelox processor <2013> Jim Hamblen
clu67 0:a1c374b9a4fe 6 //
clu67 0:a1c374b9a4fe 7 // uLCD_4DGL is free software: you can redistribute it and/or modify
clu67 0:a1c374b9a4fe 8 // it under the terms of the GNU General Public License as published by
clu67 0:a1c374b9a4fe 9 // the Free Software Foundation, either version 3 of the License, or
clu67 0:a1c374b9a4fe 10 // (at your option) any later version.
clu67 0:a1c374b9a4fe 11 //
clu67 0:a1c374b9a4fe 12 // uLCD_4DGL is distributed in the hope that it will be useful,
clu67 0:a1c374b9a4fe 13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
clu67 0:a1c374b9a4fe 14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
clu67 0:a1c374b9a4fe 15 // GNU General Public License for more details.
clu67 0:a1c374b9a4fe 16 //
clu67 0:a1c374b9a4fe 17 // You should have received a copy of the GNU General Public License
clu67 0:a1c374b9a4fe 18 // along with uLCD_4DGL. If not, see <http://www.gnu.org/licenses/>.
clu67 0:a1c374b9a4fe 19
clu67 0:a1c374b9a4fe 20 #include "mbed.h"
clu67 0:a1c374b9a4fe 21 #include "uLCD_4DGL.h"
clu67 0:a1c374b9a4fe 22
clu67 0:a1c374b9a4fe 23 #define ARRAY_SIZE(X) sizeof(X)/sizeof(X[0])
clu67 0:a1c374b9a4fe 24
clu67 0:a1c374b9a4fe 25 //****************************************************************************************************
clu67 0:a1c374b9a4fe 26 void uLCD_4DGL :: circle(int x, int y , int radius, int color) // draw a circle in (x,y)
clu67 0:a1c374b9a4fe 27 {
clu67 0:a1c374b9a4fe 28 char command[9]= "";
clu67 0:a1c374b9a4fe 29
clu67 0:a1c374b9a4fe 30 command[0] = CIRCLE;
clu67 0:a1c374b9a4fe 31
clu67 0:a1c374b9a4fe 32 command[1] = (x >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 33 command[2] = x & 0xFF;
clu67 0:a1c374b9a4fe 34
clu67 0:a1c374b9a4fe 35 command[3] = (y >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 36 command[4] = y & 0xFF;
clu67 0:a1c374b9a4fe 37
clu67 0:a1c374b9a4fe 38 command[5] = (radius >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 39 command[6] = radius & 0xFF;
clu67 0:a1c374b9a4fe 40
clu67 0:a1c374b9a4fe 41 int red5 = (color >> (16 + 3)) & 0x1F; // get red on 5 bits
clu67 0:a1c374b9a4fe 42 int green6 = (color >> (8 + 2)) & 0x3F; // get green on 6 bits
clu67 0:a1c374b9a4fe 43 int blue5 = (color >> (0 + 3)) & 0x1F; // get blue on 5 bits
clu67 0:a1c374b9a4fe 44
clu67 0:a1c374b9a4fe 45 command[7] = ((red5 << 3) + (green6 >> 3)) & 0xFF; // first part of 16 bits color
clu67 0:a1c374b9a4fe 46 command[8] = ((green6 << 5) + (blue5 >> 0)) & 0xFF; // second part of 16 bits color
clu67 0:a1c374b9a4fe 47
clu67 0:a1c374b9a4fe 48 writeCOMMAND(command, 9);
clu67 0:a1c374b9a4fe 49 }
clu67 0:a1c374b9a4fe 50 //****************************************************************************************************
clu67 0:a1c374b9a4fe 51 void uLCD_4DGL :: filled_circle(int x, int y , int radius, int color) // draw a circle in (x,y)
clu67 0:a1c374b9a4fe 52 {
clu67 0:a1c374b9a4fe 53 char command[9]= "";
clu67 0:a1c374b9a4fe 54
clu67 0:a1c374b9a4fe 55 command[0] = FCIRCLE;
clu67 0:a1c374b9a4fe 56
clu67 0:a1c374b9a4fe 57 command[1] = (x >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 58 command[2] = x & 0xFF;
clu67 0:a1c374b9a4fe 59
clu67 0:a1c374b9a4fe 60 command[3] = (y >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 61 command[4] = y & 0xFF;
clu67 0:a1c374b9a4fe 62
clu67 0:a1c374b9a4fe 63 command[5] = (radius >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 64 command[6] = radius & 0xFF;
clu67 0:a1c374b9a4fe 65
clu67 0:a1c374b9a4fe 66 int red5 = (color >> (16 + 3)) & 0x1F; // get red on 5 bits
clu67 0:a1c374b9a4fe 67 int green6 = (color >> (8 + 2)) & 0x3F; // get green on 6 bits
clu67 0:a1c374b9a4fe 68 int blue5 = (color >> (0 + 3)) & 0x1F; // get blue on 5 bits
clu67 0:a1c374b9a4fe 69
clu67 0:a1c374b9a4fe 70 command[7] = ((red5 << 3) + (green6 >> 3)) & 0xFF; // first part of 16 bits color
clu67 0:a1c374b9a4fe 71 command[8] = ((green6 << 5) + (blue5 >> 0)) & 0xFF; // second part of 16 bits color
clu67 0:a1c374b9a4fe 72
clu67 0:a1c374b9a4fe 73 writeCOMMAND(command, 9);
clu67 0:a1c374b9a4fe 74 }
clu67 0:a1c374b9a4fe 75
clu67 0:a1c374b9a4fe 76 //****************************************************************************************************
clu67 0:a1c374b9a4fe 77 void uLCD_4DGL :: triangle(int x1, int y1 , int x2, int y2, int x3, int y3, int color) // draw a traingle
clu67 0:a1c374b9a4fe 78 {
clu67 0:a1c374b9a4fe 79 char command[15]= "";
clu67 0:a1c374b9a4fe 80
clu67 0:a1c374b9a4fe 81 command[0] = TRIANGLE;
clu67 0:a1c374b9a4fe 82
clu67 0:a1c374b9a4fe 83 command[1] = (x1 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 84 command[2] = x1 & 0xFF;
clu67 0:a1c374b9a4fe 85
clu67 0:a1c374b9a4fe 86 command[3] = (y1 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 87 command[4] = y1 & 0xFF;
clu67 0:a1c374b9a4fe 88
clu67 0:a1c374b9a4fe 89 command[5] = (x2 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 90 command[6] = x2 & 0xFF;
clu67 0:a1c374b9a4fe 91
clu67 0:a1c374b9a4fe 92 command[7] = (y2 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 93 command[8] = y2 & 0xFF;
clu67 0:a1c374b9a4fe 94
clu67 0:a1c374b9a4fe 95 command[9] = (x3 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 96 command[10] = x3 & 0xFF;
clu67 0:a1c374b9a4fe 97
clu67 0:a1c374b9a4fe 98 command[11] = (y3 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 99 command[12] = y3 & 0xFF;
clu67 0:a1c374b9a4fe 100
clu67 0:a1c374b9a4fe 101 int red5 = (color >> (16 + 3)) & 0x1F; // get red on 5 bits
clu67 0:a1c374b9a4fe 102 int green6 = (color >> (8 + 2)) & 0x3F; // get green on 6 bits
clu67 0:a1c374b9a4fe 103 int blue5 = (color >> (0 + 3)) & 0x1F; // get blue on 5 bits
clu67 0:a1c374b9a4fe 104
clu67 0:a1c374b9a4fe 105 command[13] = ((red5 << 3) + (green6 >> 3)) & 0xFF; // first part of 16 bits color
clu67 0:a1c374b9a4fe 106 command[14] = ((green6 << 5) + (blue5 >> 0)) & 0xFF; // second part of 16 bits color
clu67 0:a1c374b9a4fe 107
clu67 0:a1c374b9a4fe 108 writeCOMMAND(command, 15);
clu67 0:a1c374b9a4fe 109 }
clu67 0:a1c374b9a4fe 110
clu67 0:a1c374b9a4fe 111 //****************************************************************************************************
clu67 0:a1c374b9a4fe 112 void uLCD_4DGL :: line(int x1, int y1 , int x2, int y2, int color) // draw a line
clu67 0:a1c374b9a4fe 113 {
clu67 0:a1c374b9a4fe 114 char command[11]= "";
clu67 0:a1c374b9a4fe 115
clu67 0:a1c374b9a4fe 116 command[0] = LINE;
clu67 0:a1c374b9a4fe 117
clu67 0:a1c374b9a4fe 118 command[1] = (x1 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 119 command[2] = x1 & 0xFF;
clu67 0:a1c374b9a4fe 120
clu67 0:a1c374b9a4fe 121 command[3] = (y1 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 122 command[4] = y1 & 0xFF;
clu67 0:a1c374b9a4fe 123
clu67 0:a1c374b9a4fe 124 command[5] = (x2 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 125 command[6] = x2 & 0xFF;
clu67 0:a1c374b9a4fe 126
clu67 0:a1c374b9a4fe 127 command[7] = (y2 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 128 command[8] = y2 & 0xFF;
clu67 0:a1c374b9a4fe 129
clu67 0:a1c374b9a4fe 130 int red5 = (color >> (16 + 3)) & 0x1F; // get red on 5 bits
clu67 0:a1c374b9a4fe 131 int green6 = (color >> (8 + 2)) & 0x3F; // get green on 6 bits
clu67 0:a1c374b9a4fe 132 int blue5 = (color >> (0 + 3)) & 0x1F; // get blue on 5 bits
clu67 0:a1c374b9a4fe 133
clu67 0:a1c374b9a4fe 134 command[9] = ((red5 << 3) + (green6 >> 3)) & 0xFF; // first part of 16 bits color
clu67 0:a1c374b9a4fe 135 command[10] = ((green6 << 5) + (blue5 >> 0)) & 0xFF; // second part of 16 bits color
clu67 0:a1c374b9a4fe 136
clu67 0:a1c374b9a4fe 137 writeCOMMAND(command, 11);
clu67 0:a1c374b9a4fe 138 }
clu67 0:a1c374b9a4fe 139
clu67 0:a1c374b9a4fe 140 //****************************************************************************************************
clu67 0:a1c374b9a4fe 141 void uLCD_4DGL :: rectangle(int x1, int y1 , int x2, int y2, int color) // draw a rectangle
clu67 0:a1c374b9a4fe 142 {
clu67 0:a1c374b9a4fe 143 char command[11]= "";
clu67 0:a1c374b9a4fe 144
clu67 0:a1c374b9a4fe 145 command[0] = RECTANGLE;
clu67 0:a1c374b9a4fe 146
clu67 0:a1c374b9a4fe 147 command[1] = (x1 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 148 command[2] = x1 & 0xFF;
clu67 0:a1c374b9a4fe 149
clu67 0:a1c374b9a4fe 150 command[3] = (y1 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 151 command[4] = y1 & 0xFF;
clu67 0:a1c374b9a4fe 152
clu67 0:a1c374b9a4fe 153 command[5] = (x2 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 154 command[6] = x2 & 0xFF;
clu67 0:a1c374b9a4fe 155
clu67 0:a1c374b9a4fe 156 command[7] = (y2 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 157 command[8] = y2 & 0xFF;
clu67 0:a1c374b9a4fe 158
clu67 0:a1c374b9a4fe 159 int red5 = (color >> (16 + 3)) & 0x1F; // get red on 5 bits
clu67 0:a1c374b9a4fe 160 int green6 = (color >> (8 + 2)) & 0x3F; // get green on 6 bits
clu67 0:a1c374b9a4fe 161 int blue5 = (color >> (0 + 3)) & 0x1F; // get blue on 5 bits
clu67 0:a1c374b9a4fe 162
clu67 0:a1c374b9a4fe 163 command[9] = ((red5 << 3) + (green6 >> 3)) & 0xFF; // first part of 16 bits color
clu67 0:a1c374b9a4fe 164 command[10] = ((green6 << 5) + (blue5 >> 0)) & 0xFF; // second part of 16 bits color
clu67 0:a1c374b9a4fe 165
clu67 0:a1c374b9a4fe 166 writeCOMMAND(command, 11);
clu67 0:a1c374b9a4fe 167 }
clu67 0:a1c374b9a4fe 168
clu67 0:a1c374b9a4fe 169 //****************************************************************************************************
clu67 0:a1c374b9a4fe 170 void uLCD_4DGL :: filled_rectangle(int x1, int y1 , int x2, int y2, int color) // draw a rectangle
clu67 0:a1c374b9a4fe 171 {
clu67 0:a1c374b9a4fe 172 char command[11]= "";
clu67 0:a1c374b9a4fe 173
clu67 0:a1c374b9a4fe 174 command[0] = FRECTANGLE;
clu67 0:a1c374b9a4fe 175
clu67 0:a1c374b9a4fe 176 command[1] = (x1 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 177 command[2] = x1 & 0xFF;
clu67 0:a1c374b9a4fe 178
clu67 0:a1c374b9a4fe 179 command[3] = (y1 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 180 command[4] = y1 & 0xFF;
clu67 0:a1c374b9a4fe 181
clu67 0:a1c374b9a4fe 182 command[5] = (x2 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 183 command[6] = x2 & 0xFF;
clu67 0:a1c374b9a4fe 184
clu67 0:a1c374b9a4fe 185 command[7] = (y2 >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 186 command[8] = y2 & 0xFF;
clu67 0:a1c374b9a4fe 187
clu67 0:a1c374b9a4fe 188 int red5 = (color >> (16 + 3)) & 0x1F; // get red on 5 bits
clu67 0:a1c374b9a4fe 189 int green6 = (color >> (8 + 2)) & 0x3F; // get green on 6 bits
clu67 0:a1c374b9a4fe 190 int blue5 = (color >> (0 + 3)) & 0x1F; // get blue on 5 bits
clu67 0:a1c374b9a4fe 191
clu67 0:a1c374b9a4fe 192 command[9] = ((red5 << 3) + (green6 >> 3)) & 0xFF; // first part of 16 bits color
clu67 0:a1c374b9a4fe 193 command[10] = ((green6 << 5) + (blue5 >> 0)) & 0xFF; // second part of 16 bits color
clu67 0:a1c374b9a4fe 194
clu67 0:a1c374b9a4fe 195 writeCOMMAND(command, 11);
clu67 0:a1c374b9a4fe 196 }
clu67 0:a1c374b9a4fe 197
clu67 0:a1c374b9a4fe 198
clu67 0:a1c374b9a4fe 199
clu67 0:a1c374b9a4fe 200 //****************************************************************************************************
clu67 0:a1c374b9a4fe 201 void uLCD_4DGL :: pixel(int x, int y, int color) // draw a pixel
clu67 0:a1c374b9a4fe 202 {
clu67 0:a1c374b9a4fe 203 char command[7]= "";
clu67 0:a1c374b9a4fe 204
clu67 0:a1c374b9a4fe 205 command[0] = PIXEL;
clu67 0:a1c374b9a4fe 206
clu67 0:a1c374b9a4fe 207 command[1] = (x >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 208 command[2] = x & 0xFF;
clu67 0:a1c374b9a4fe 209
clu67 0:a1c374b9a4fe 210 command[3] = (y >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 211 command[4] = y & 0xFF;
clu67 0:a1c374b9a4fe 212
clu67 0:a1c374b9a4fe 213 int red5 = (color >> (16 + 3)) & 0x1F; // get red on 5 bits
clu67 0:a1c374b9a4fe 214 int green6 = (color >> (8 + 2)) & 0x3F; // get green on 6 bits
clu67 0:a1c374b9a4fe 215 int blue5 = (color >> (0 + 3)) & 0x1F; // get blue on 5 bits
clu67 0:a1c374b9a4fe 216
clu67 0:a1c374b9a4fe 217 command[5] = ((red5 << 3) + (green6 >> 3)) & 0xFF; // first part of 16 bits color
clu67 0:a1c374b9a4fe 218 command[6] = ((green6 << 5) + (blue5 >> 0)) & 0xFF; // second part of 16 bits color
clu67 0:a1c374b9a4fe 219
clu67 0:a1c374b9a4fe 220 writeCOMMAND(command, 7);
clu67 0:a1c374b9a4fe 221 }
clu67 0:a1c374b9a4fe 222 //****************************************************************************************************
clu67 0:a1c374b9a4fe 223 void uLCD_4DGL :: BLIT(int x, int y, int w, int h, int *colors) // draw a block of pixels
clu67 0:a1c374b9a4fe 224 {
clu67 0:a1c374b9a4fe 225 int red5, green6, blue5;
clu67 0:a1c374b9a4fe 226 writeBYTEfast('\x00');
clu67 0:a1c374b9a4fe 227 writeBYTEfast(BLITCOM);
clu67 0:a1c374b9a4fe 228 writeBYTEfast((x >> 8) & 0xFF);
clu67 0:a1c374b9a4fe 229 writeBYTEfast(x & 0xFF);
clu67 0:a1c374b9a4fe 230 writeBYTEfast((y >> 8) & 0xFF);
clu67 0:a1c374b9a4fe 231 writeBYTEfast(y & 0xFF);
clu67 0:a1c374b9a4fe 232 writeBYTEfast((w >> 8) & 0xFF);
clu67 0:a1c374b9a4fe 233 writeBYTE(w & 0xFF);
clu67 0:a1c374b9a4fe 234 writeBYTE((h >> 8) & 0xFF);
clu67 0:a1c374b9a4fe 235 writeBYTE(h & 0xFF);
clu67 0:a1c374b9a4fe 236 wait_ms(1);
clu67 0:a1c374b9a4fe 237 for (int i=0; i<w*h; i++) {
clu67 0:a1c374b9a4fe 238 red5 = (colors[i] >> (16 + 3)) & 0x1F; // get red on 5 bits
clu67 0:a1c374b9a4fe 239 green6 = (colors[i] >> (8 + 2)) & 0x3F; // get green on 6 bits
clu67 0:a1c374b9a4fe 240 blue5 = (colors[i] >> (0 + 3)) & 0x1F; // get blue on 5 bits
clu67 0:a1c374b9a4fe 241 writeBYTEfast(((red5 << 3) + (green6 >> 3)) & 0xFF); // first part of 16 bits color
clu67 0:a1c374b9a4fe 242 writeBYTEfast(((green6 << 5) + (blue5 >> 0)) & 0xFF); // second part of 16 bits color
clu67 0:a1c374b9a4fe 243 }
clu67 0:a1c374b9a4fe 244 int resp=0;
clu67 0:a1c374b9a4fe 245 while (!_cmd.readable()) wait_ms(TEMPO); // wait for screen answer
clu67 0:a1c374b9a4fe 246 if (_cmd.readable()) resp = _cmd.getc(); // read response if any
clu67 0:a1c374b9a4fe 247 switch (resp) {
clu67 0:a1c374b9a4fe 248 case ACK : // if OK return 1
clu67 0:a1c374b9a4fe 249 resp = 1;
clu67 0:a1c374b9a4fe 250 break;
clu67 0:a1c374b9a4fe 251 case NAK : // if NOK return -1
clu67 0:a1c374b9a4fe 252 resp = -1;
clu67 0:a1c374b9a4fe 253 break;
clu67 0:a1c374b9a4fe 254 default :
clu67 0:a1c374b9a4fe 255 resp = 0; // else return 0
clu67 0:a1c374b9a4fe 256 break;
clu67 0:a1c374b9a4fe 257 }
clu67 0:a1c374b9a4fe 258 #if DEBUGMODE
clu67 0:a1c374b9a4fe 259 pc.printf(" Answer received : %d\n",resp);
clu67 0:a1c374b9a4fe 260 #endif
clu67 0:a1c374b9a4fe 261
clu67 0:a1c374b9a4fe 262 }
clu67 0:a1c374b9a4fe 263 //******************************************************************************************************
clu67 0:a1c374b9a4fe 264 int uLCD_4DGL :: read_pixel(int x, int y) // read screen info and populate data
clu67 0:a1c374b9a4fe 265 {
clu67 0:a1c374b9a4fe 266
clu67 0:a1c374b9a4fe 267 char command[6]= "";
clu67 0:a1c374b9a4fe 268 command[0] = 0xFF;
clu67 0:a1c374b9a4fe 269 command[1] = READPIXEL;
clu67 0:a1c374b9a4fe 270
clu67 0:a1c374b9a4fe 271 command[2] = (x >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 272 command[3] = x & 0xFF;
clu67 0:a1c374b9a4fe 273
clu67 0:a1c374b9a4fe 274 command[4] = (y >> 8) & 0xFF;
clu67 0:a1c374b9a4fe 275 command[5] = y & 0xFF;
clu67 0:a1c374b9a4fe 276
clu67 0:a1c374b9a4fe 277 int i, temp = 0, color = 0, resp = 0;
clu67 0:a1c374b9a4fe 278 char response[3] = "";
clu67 0:a1c374b9a4fe 279
clu67 0:a1c374b9a4fe 280 freeBUFFER();
clu67 0:a1c374b9a4fe 281
clu67 0:a1c374b9a4fe 282 for (i = 0; i < 6; i++) { // send all chars to serial port
clu67 0:a1c374b9a4fe 283 writeBYTE(command[i]);
clu67 0:a1c374b9a4fe 284 }
clu67 0:a1c374b9a4fe 285
clu67 0:a1c374b9a4fe 286 while (!_cmd.readable()) wait_ms(TEMPO); // wait a bit for screen answer
clu67 0:a1c374b9a4fe 287
clu67 0:a1c374b9a4fe 288 while ( resp < ARRAY_SIZE(response)) { //read ack and 16-bit color response
clu67 0:a1c374b9a4fe 289 temp = _cmd.getc();
clu67 0:a1c374b9a4fe 290 response[resp++] = (char)temp;
clu67 0:a1c374b9a4fe 291 }
clu67 0:a1c374b9a4fe 292
clu67 0:a1c374b9a4fe 293 color = ((response[1] << 8) + response[2]);
clu67 0:a1c374b9a4fe 294
clu67 0:a1c374b9a4fe 295 return color;
clu67 0:a1c374b9a4fe 296 }
clu67 0:a1c374b9a4fe 297
clu67 0:a1c374b9a4fe 298
clu67 0:a1c374b9a4fe 299 //****************************************************************************************************
clu67 0:a1c374b9a4fe 300 void uLCD_4DGL :: pen_size(char mode) // set pen to SOLID or WIREFRAME
clu67 0:a1c374b9a4fe 301 {
clu67 0:a1c374b9a4fe 302 char command[2]= "";
clu67 0:a1c374b9a4fe 303
clu67 0:a1c374b9a4fe 304 command[0] = PENSIZE;
clu67 0:a1c374b9a4fe 305 command[1] = mode;
clu67 0:a1c374b9a4fe 306 writeCOMMAND(command, 2);
clu67 0:a1c374b9a4fe 307 }
clu67 0:a1c374b9a4fe 308
clu67 0:a1c374b9a4fe 309
clu67 0:a1c374b9a4fe 310
clu67 0:a1c374b9a4fe 311