![](/media/cache/profiles/9bd5ee6fe55aaeb673025dbcb8f939c1.50x50_q85.jpg)
UniGraphic library test using MPS2+
Dependencies: MMA8451Q SPI_STMPE610 UniGraphic mbed
Fork of testUniGraphic_150217 by
main.cpp@4:76d15fd29c9f, 2017-02-21 (annotated)
- Committer:
- MACRUM
- Date:
- Tue Feb 21 13:37:48 2017 +0000
- Revision:
- 4:76d15fd29c9f
- Parent:
- 3:1cd979ad1e1d
MPS2+ board test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Rhyme | 0:be311b6a294c | 1 | #include "mbed.h" |
MACRUM | 4:76d15fd29c9f | 2 | //#include "MMA8451Q.h" |
Rhyme | 0:be311b6a294c | 3 | #include <ILI9341.h> |
Rhyme | 0:be311b6a294c | 4 | #include "Arial12x12.h" |
Rhyme | 0:be311b6a294c | 5 | #include "Arial24x23.h" |
Rhyme | 0:be311b6a294c | 6 | #include "Arial28x28.h" |
Rhyme | 0:be311b6a294c | 7 | #include "Arial43x48_numb.h" |
Rhyme | 0:be311b6a294c | 8 | #include "SPI_STMPE610.h" |
Rhyme | 0:be311b6a294c | 9 | #include "main.h" |
Rhyme | 0:be311b6a294c | 10 | |
Rhyme | 0:be311b6a294c | 11 | DigitalOut myled(LED1); |
MACRUM | 4:76d15fd29c9f | 12 | ILI9341 TFT(SPI_8, 48000000, |
Rhyme | 0:be311b6a294c | 13 | PIN_MOSI, PIN_MISO, PIN_SCLK, |
Rhyme | 0:be311b6a294c | 14 | PIN_CS_TFT, PIN_RESET_TFT, PIN_DC_TFT, "Adafruit2.8") ; |
MACRUM | 4:76d15fd29c9f | 15 | |
MACRUM | 4:76d15fd29c9f | 16 | //SPI_STMPE610 TSC(PIN_MOSI, PIN_MISO, PIN_SCLK, PIN_CS_TSC) ; |
Rhyme | 0:be311b6a294c | 17 | |
Rhyme | 0:be311b6a294c | 18 | DigitalOut backlight(PIN_BL_TFT) ; |
Rhyme | 0:be311b6a294c | 19 | |
Rhyme | 0:be311b6a294c | 20 | #define MMA8451_I2C_ADDRESS (0x1d<<1) |
MACRUM | 4:76d15fd29c9f | 21 | //MMA8451Q *acc = 0 ; |
Rhyme | 0:be311b6a294c | 22 | |
Rhyme | 0:be311b6a294c | 23 | int page = 0 ; |
Rhyme | 0:be311b6a294c | 24 | int numPage = 3 ; |
Rhyme | 0:be311b6a294c | 25 | |
Rhyme | 0:be311b6a294c | 26 | void initTFT(void) |
Rhyme | 0:be311b6a294c | 27 | { |
Rhyme | 0:be311b6a294c | 28 | //Configure the display driver |
Rhyme | 3:1cd979ad1e1d | 29 | TFT.FastWindow(true) ; |
Rhyme | 0:be311b6a294c | 30 | TFT.background(Black); |
Rhyme | 0:be311b6a294c | 31 | TFT.foreground(White); |
Rhyme | 0:be311b6a294c | 32 | wait(0.01) ; |
Rhyme | 0:be311b6a294c | 33 | TFT.cls(); |
Rhyme | 0:be311b6a294c | 34 | } |
Rhyme | 0:be311b6a294c | 35 | |
Rhyme | 0:be311b6a294c | 36 | void screen1(void) // Welcome Screen |
Rhyme | 0:be311b6a294c | 37 | { |
MACRUM | 4:76d15fd29c9f | 38 | printf("screen1\n"); |
Rhyme | 0:be311b6a294c | 39 | backlight = 0 ; |
Rhyme | 1:6cd56ddffb40 | 40 | TFT.BusEnable(true) ; |
Rhyme | 0:be311b6a294c | 41 | TFT.background(White) ; |
Rhyme | 0:be311b6a294c | 42 | TFT.cls() ; |
MACRUM | 4:76d15fd29c9f | 43 | printf("screen clear\n"); |
Rhyme | 0:be311b6a294c | 44 | |
Rhyme | 0:be311b6a294c | 45 | wait(0.1) ; |
Rhyme | 0:be311b6a294c | 46 | TFT.set_font((unsigned char*) Arial24x23); |
Rhyme | 0:be311b6a294c | 47 | TFT.foreground(Red) ; |
Rhyme | 1:6cd56ddffb40 | 48 | TFT.locate(80, 30) ; |
Rhyme | 0:be311b6a294c | 49 | TFT.printf("MBED") ; |
Rhyme | 0:be311b6a294c | 50 | TFT.foreground(Blue); |
Rhyme | 1:6cd56ddffb40 | 51 | TFT.locate(60, 60) ; |
Rhyme | 0:be311b6a294c | 52 | TFT.printf("2.8\"TFT") ; |
Rhyme | 1:6cd56ddffb40 | 53 | TFT.locate(40, 90) ; |
Rhyme | 0:be311b6a294c | 54 | TFT.printf("with touch") ; |
Rhyme | 1:6cd56ddffb40 | 55 | TFT.foreground(Green) ; |
Rhyme | 1:6cd56ddffb40 | 56 | TFT.locate(10, 130) ; |
Rhyme | 1:6cd56ddffb40 | 57 | TFT.printf("UniGraphic Ver.") ; |
Rhyme | 0:be311b6a294c | 58 | TFT.foreground(Black); |
Rhyme | 0:be311b6a294c | 59 | TFT.set_font((unsigned char*) Arial12x12); |
Rhyme | 0:be311b6a294c | 60 | TFT.foreground(Blue) ; |
Rhyme | 1:6cd56ddffb40 | 61 | TFT.locate(20, 180) ; |
Rhyme | 0:be311b6a294c | 62 | TFT.printf("This program is running on") ; |
Rhyme | 1:6cd56ddffb40 | 63 | TFT.locate(20, 200) ; |
Rhyme | 0:be311b6a294c | 64 | TFT.printf("freescale FRDM-KL25Z with") ; |
Rhyme | 1:6cd56ddffb40 | 65 | TFT.locate(20, 220) ; |
Rhyme | 0:be311b6a294c | 66 | TFT.printf("a program developed on mbed") ; |
Rhyme | 0:be311b6a294c | 67 | TFT.foreground(Green) ; |
Rhyme | 1:6cd56ddffb40 | 68 | TFT.locate(20, 260) ; |
Rhyme | 0:be311b6a294c | 69 | TFT.printf("To advance demo page, touch") ; |
Rhyme | 1:6cd56ddffb40 | 70 | TFT.locate(20, 280) ; |
Rhyme | 0:be311b6a294c | 71 | TFT.printf("and hold right side of screen") ; |
Rhyme | 1:6cd56ddffb40 | 72 | TFT.locate(20, 300) ; |
Rhyme | 0:be311b6a294c | 73 | TFT.printf("until the next screen starts") ; |
Rhyme | 1:6cd56ddffb40 | 74 | TFT.BusEnable(false) ; |
Rhyme | 0:be311b6a294c | 75 | backlight = 1 ; |
Rhyme | 0:be311b6a294c | 76 | } |
Rhyme | 0:be311b6a294c | 77 | |
Rhyme | 0:be311b6a294c | 78 | void screen2(void) // Graphics |
Rhyme | 0:be311b6a294c | 79 | { |
Rhyme | 0:be311b6a294c | 80 | //Draw some graphics |
Rhyme | 0:be311b6a294c | 81 | int i, x[2], y[2] ; |
Rhyme | 0:be311b6a294c | 82 | backlight = 0 ; |
Rhyme | 1:6cd56ddffb40 | 83 | TFT.BusEnable(true) ; |
Rhyme | 1:6cd56ddffb40 | 84 | |
Rhyme | 0:be311b6a294c | 85 | TFT.background(Black); |
Rhyme | 0:be311b6a294c | 86 | TFT.foreground(White); |
Rhyme | 0:be311b6a294c | 87 | TFT.cls() ; |
Rhyme | 0:be311b6a294c | 88 | TFT.set_font((unsigned char*) Arial12x12); |
Rhyme | 0:be311b6a294c | 89 | TFT.locate(90,0); |
Rhyme | 0:be311b6a294c | 90 | TFT.printf("Graphics"); |
Rhyme | 0:be311b6a294c | 91 | |
Rhyme | 0:be311b6a294c | 92 | x[0] = 25 ; x[1] = 224 ; |
Rhyme | 0:be311b6a294c | 93 | y[0] = 20 ; y[1] = 219 ; |
Rhyme | 0:be311b6a294c | 94 | for (i = 20 ; i < 220 ; i += 10) { |
Rhyme | 0:be311b6a294c | 95 | TFT.line(i+5, y[0], i+5, y[1], Blue) ; |
Rhyme | 0:be311b6a294c | 96 | TFT.line(x[0], i, x[1], i, Blue) ; |
Rhyme | 0:be311b6a294c | 97 | } |
Rhyme | 0:be311b6a294c | 98 | TFT.line(125, y[0], 125, y[1], Green) ; |
Rhyme | 0:be311b6a294c | 99 | TFT.line(x[0], 120, x[1], 120, Green) ; |
Rhyme | 0:be311b6a294c | 100 | TFT.rect(x[0],y[0], x[1], y[1], Green) ; |
Rhyme | 0:be311b6a294c | 101 | TFT.locate(10, 20) ; |
Rhyme | 0:be311b6a294c | 102 | TFT.printf("V") ; |
Rhyme | 0:be311b6a294c | 103 | TFT.locate(0, 115) ; |
Rhyme | 0:be311b6a294c | 104 | TFT.printf("0.0") ; |
Rhyme | 0:be311b6a294c | 105 | TFT.locate(115, 225) ; |
Rhyme | 0:be311b6a294c | 106 | TFT.printf("0.0") ; |
Rhyme | 0:be311b6a294c | 107 | TFT.locate(215, 225) ; |
Rhyme | 0:be311b6a294c | 108 | TFT.printf("T") ; |
Rhyme | 0:be311b6a294c | 109 | |
Rhyme | 0:be311b6a294c | 110 | double s; |
Rhyme | 0:be311b6a294c | 111 | for (int i = x[0]; i < 225; i++) { |
Rhyme | 0:be311b6a294c | 112 | s = 40 * sin((long double)i / 20); |
Rhyme | 0:be311b6a294c | 113 | TFT.pixel(i, 120 + (int)s, White); |
Rhyme | 0:be311b6a294c | 114 | } |
Rhyme | 0:be311b6a294c | 115 | |
Rhyme | 0:be311b6a294c | 116 | TFT.fillrect(10, 240, 229, 309, White) ; |
Rhyme | 0:be311b6a294c | 117 | TFT.rect(10, 240, 229, 309, Red) ; |
Rhyme | 0:be311b6a294c | 118 | TFT.rect(11, 241, 228, 308, Red) ; |
Rhyme | 0:be311b6a294c | 119 | |
Rhyme | 0:be311b6a294c | 120 | TFT.background(White) ; |
Rhyme | 0:be311b6a294c | 121 | TFT.foreground(Black) ; |
Rhyme | 0:be311b6a294c | 122 | TFT.locate(20, 250) ; |
Rhyme | 0:be311b6a294c | 123 | TFT.printf("With QVGA resolution") ; |
Rhyme | 0:be311b6a294c | 124 | TFT.locate(20, 270) ; |
Rhyme | 0:be311b6a294c | 125 | TFT.printf("simple graphics drawing") ; |
Rhyme | 0:be311b6a294c | 126 | TFT.locate(20, 290) ; |
Rhyme | 0:be311b6a294c | 127 | TFT.printf("capability is provided") ; |
Rhyme | 1:6cd56ddffb40 | 128 | |
Rhyme | 1:6cd56ddffb40 | 129 | TFT.BusEnable(false) ; |
Rhyme | 0:be311b6a294c | 130 | backlight = 1 ; |
Rhyme | 0:be311b6a294c | 131 | } |
Rhyme | 0:be311b6a294c | 132 | |
Rhyme | 0:be311b6a294c | 133 | double clip(double src) |
Rhyme | 0:be311b6a294c | 134 | { |
Rhyme | 0:be311b6a294c | 135 | double value ; |
Rhyme | 0:be311b6a294c | 136 | value = src ; |
Rhyme | 0:be311b6a294c | 137 | if (value < 0.0) { |
Rhyme | 0:be311b6a294c | 138 | value = 0.0 ; |
Rhyme | 0:be311b6a294c | 139 | } else if (value > 2.0) { |
Rhyme | 0:be311b6a294c | 140 | value = 2.0 ; |
Rhyme | 0:be311b6a294c | 141 | } |
Rhyme | 0:be311b6a294c | 142 | return( value ) ; |
Rhyme | 0:be311b6a294c | 143 | } |
Rhyme | 0:be311b6a294c | 144 | |
Rhyme | 0:be311b6a294c | 145 | void screen3(void) |
Rhyme | 0:be311b6a294c | 146 | { |
Rhyme | 0:be311b6a294c | 147 | int t = 0 ; |
Rhyme | 0:be311b6a294c | 148 | int pt = 0 ; // previous t |
Rhyme | 0:be311b6a294c | 149 | int i, x, y ; |
Rhyme | 0:be311b6a294c | 150 | unsigned int data[3] ; // for x, y, z |
Rhyme | 0:be311b6a294c | 151 | unsigned int prev[3] ; |
Rhyme | 0:be311b6a294c | 152 | unsigned short signalHeight = 39 ; |
Rhyme | 0:be311b6a294c | 153 | unsigned short xoffset = 30 ; |
Rhyme | 0:be311b6a294c | 154 | unsigned short yoffset = 120 ; |
Rhyme | 0:be311b6a294c | 155 | unsigned short zoffset = 210 ; |
Rhyme | 0:be311b6a294c | 156 | unsigned short paneX[2] = {20, 235} ; |
Rhyme | 0:be311b6a294c | 157 | unsigned short paneH = 81 ; |
Rhyme | 0:be311b6a294c | 158 | |
Rhyme | 0:be311b6a294c | 159 | backlight = 0 ; |
Rhyme | 1:6cd56ddffb40 | 160 | TFT.BusEnable(true) ; |
Rhyme | 0:be311b6a294c | 161 | TFT.background(Black) ; |
Rhyme | 0:be311b6a294c | 162 | TFT.foreground(White) ; |
Rhyme | 0:be311b6a294c | 163 | // TFT.cls() ; |
Rhyme | 0:be311b6a294c | 164 | |
Rhyme | 0:be311b6a294c | 165 | |
Rhyme | 0:be311b6a294c | 166 | TFT.fillrect(paneX[0], xoffset, paneX[1], xoffset+paneH, Black) ; |
Rhyme | 0:be311b6a294c | 167 | TFT.fillrect(paneX[0], yoffset, paneX[1], yoffset+paneH, Black) ; |
Rhyme | 0:be311b6a294c | 168 | TFT.fillrect(paneX[0], zoffset, paneX[1], zoffset+paneH, Black) ; |
Rhyme | 0:be311b6a294c | 169 | TFT.fillrect(paneX[0], xoffset, paneX[1], xoffset+paneH, Black) ; |
Rhyme | 0:be311b6a294c | 170 | for (i = 0 ; i < 10 ; i++ ) { |
Rhyme | 0:be311b6a294c | 171 | y = i * 8 ; |
Rhyme | 0:be311b6a294c | 172 | TFT.line(paneX[0], xoffset + y, paneX[1], xoffset + y, Blue) ; |
Rhyme | 0:be311b6a294c | 173 | TFT.line(paneX[0], yoffset + y, paneX[1], yoffset + y, Blue) ; |
Rhyme | 0:be311b6a294c | 174 | TFT.line(paneX[0], zoffset + y, paneX[1], zoffset + y, Blue) ; |
Rhyme | 0:be311b6a294c | 175 | } |
Rhyme | 0:be311b6a294c | 176 | for (x = 30 ; x < paneX[1] ; x += 10 ) { |
Rhyme | 0:be311b6a294c | 177 | TFT.line(x, xoffset, x, xoffset+paneH, Blue) ; |
Rhyme | 0:be311b6a294c | 178 | TFT.line(x, yoffset, x, yoffset+paneH, Blue) ; |
Rhyme | 0:be311b6a294c | 179 | TFT.line(x, zoffset, x, zoffset+paneH, Blue) ; |
Rhyme | 0:be311b6a294c | 180 | } |
Rhyme | 0:be311b6a294c | 181 | TFT.rect(paneX[0], xoffset, paneX[1], xoffset+paneH, White) ; |
Rhyme | 0:be311b6a294c | 182 | TFT.rect(paneX[0], yoffset, paneX[1], yoffset+paneH, White) ; |
Rhyme | 0:be311b6a294c | 183 | TFT.rect(paneX[0], zoffset, paneX[1], zoffset+paneH, White) ; |
Rhyme | 0:be311b6a294c | 184 | TFT.set_font((unsigned char*) Arial12x12); |
Rhyme | 0:be311b6a294c | 185 | TFT.locate(5, xoffset+30) ; |
Rhyme | 0:be311b6a294c | 186 | TFT.printf("X") ; |
Rhyme | 0:be311b6a294c | 187 | TFT.locate(5, yoffset+30) ; |
Rhyme | 0:be311b6a294c | 188 | TFT.printf("Y") ; |
Rhyme | 0:be311b6a294c | 189 | TFT.locate(5, zoffset+30) ; |
Rhyme | 0:be311b6a294c | 190 | TFT.printf("Z") ; |
Rhyme | 0:be311b6a294c | 191 | TFT.locate(50, 10) ; |
Rhyme | 0:be311b6a294c | 192 | TFT.printf("Xtrinsic Accelerometer") ; |
Rhyme | 0:be311b6a294c | 193 | TFT.locate(90, 300) ; |
Rhyme | 0:be311b6a294c | 194 | TFT.printf("MMA8451Q") ; |
MACRUM | 4:76d15fd29c9f | 195 | #if 0 |
Rhyme | 0:be311b6a294c | 196 | prev[0] = xoffset + (signalHeight * clip((1.0 + acc->getAccX()))) ; |
Rhyme | 0:be311b6a294c | 197 | prev[1] = yoffset + (signalHeight * clip((1.0 + acc->getAccY()))) ; |
Rhyme | 0:be311b6a294c | 198 | prev[2] = zoffset + (signalHeight * clip((1.0 + acc->getAccZ()))) ; |
Rhyme | 0:be311b6a294c | 199 | pt = paneX[0] ; |
Rhyme | 0:be311b6a294c | 200 | backlight = 1 ; |
Rhyme | 0:be311b6a294c | 201 | for(t = 21 ; t < paneX[1] ; t++) { |
Rhyme | 0:be311b6a294c | 202 | data[0] = xoffset + (signalHeight * clip((1.0 + acc->getAccX()))) ; |
Rhyme | 0:be311b6a294c | 203 | data[1] = yoffset + (signalHeight * clip((1.0 + acc->getAccY()))) ; |
Rhyme | 0:be311b6a294c | 204 | data[2] = zoffset + (signalHeight * clip((1.0 + acc->getAccZ()))) ; |
Rhyme | 0:be311b6a294c | 205 | TFT.line(pt, prev[0], t, data[0], Red) ; |
Rhyme | 0:be311b6a294c | 206 | TFT.line(pt, prev[1], t, data[1], Green) ; |
Rhyme | 0:be311b6a294c | 207 | TFT.line(pt, prev[2], t, data[2], Yellow) ; |
Rhyme | 0:be311b6a294c | 208 | prev[0] = data[0] ; |
Rhyme | 0:be311b6a294c | 209 | prev[1] = data[1] ; |
Rhyme | 0:be311b6a294c | 210 | prev[2] = data[2] ; |
Rhyme | 0:be311b6a294c | 211 | pt = t ; |
Rhyme | 0:be311b6a294c | 212 | wait(0.01) ; |
Rhyme | 0:be311b6a294c | 213 | } |
Rhyme | 1:6cd56ddffb40 | 214 | TFT.BusEnable(false) ; |
MACRUM | 4:76d15fd29c9f | 215 | #endif |
Rhyme | 0:be311b6a294c | 216 | } |
Rhyme | 0:be311b6a294c | 217 | |
Rhyme | 0:be311b6a294c | 218 | void incPage(void) |
Rhyme | 0:be311b6a294c | 219 | { |
Rhyme | 0:be311b6a294c | 220 | page++ ; |
Rhyme | 0:be311b6a294c | 221 | if (page >= numPage) { |
Rhyme | 0:be311b6a294c | 222 | page = 0 ; |
Rhyme | 0:be311b6a294c | 223 | } |
Rhyme | 0:be311b6a294c | 224 | } |
Rhyme | 0:be311b6a294c | 225 | |
Rhyme | 0:be311b6a294c | 226 | void decPage(void) |
Rhyme | 0:be311b6a294c | 227 | { |
Rhyme | 0:be311b6a294c | 228 | page-- ; |
Rhyme | 0:be311b6a294c | 229 | if (page < 0) { |
Rhyme | 0:be311b6a294c | 230 | page = numPage - 1 ; |
Rhyme | 0:be311b6a294c | 231 | } |
Rhyme | 0:be311b6a294c | 232 | } |
Rhyme | 0:be311b6a294c | 233 | |
Rhyme | 0:be311b6a294c | 234 | int main() { |
Rhyme | 0:be311b6a294c | 235 | uint16_t x, y, z ; |
Rhyme | 0:be311b6a294c | 236 | int prevPage = 0 ; |
Rhyme | 0:be311b6a294c | 237 | |
MACRUM | 4:76d15fd29c9f | 238 | //acc = new MMA8451Q(PTE25, PTE24, MMA8451_I2C_ADDRESS) ; |
Rhyme | 0:be311b6a294c | 239 | |
MACRUM | 4:76d15fd29c9f | 240 | printf("\nInitializing TFT module\n") ; |
Rhyme | 0:be311b6a294c | 241 | initTFT() ; |
MACRUM | 4:76d15fd29c9f | 242 | printf("Initialized TFT module\n") ; |
Rhyme | 0:be311b6a294c | 243 | |
Rhyme | 0:be311b6a294c | 244 | screen1() ; |
Rhyme | 0:be311b6a294c | 245 | |
Rhyme | 0:be311b6a294c | 246 | printf("Program Started!\n\r") ; |
Rhyme | 0:be311b6a294c | 247 | |
Rhyme | 0:be311b6a294c | 248 | for(;;) { |
MACRUM | 4:76d15fd29c9f | 249 | printf("%02d: TFT width = %d, height = %d\n\r", page, TFT.width(), TFT.height()) ; |
Rhyme | 0:be311b6a294c | 250 | switch(page) { |
Rhyme | 0:be311b6a294c | 251 | case 0: |
Rhyme | 0:be311b6a294c | 252 | if (prevPage != page) { |
Rhyme | 0:be311b6a294c | 253 | screen1() ; |
Rhyme | 0:be311b6a294c | 254 | } |
Rhyme | 0:be311b6a294c | 255 | break ; |
Rhyme | 0:be311b6a294c | 256 | case 1: |
Rhyme | 0:be311b6a294c | 257 | if (prevPage != page) { |
Rhyme | 0:be311b6a294c | 258 | screen2() ; |
Rhyme | 0:be311b6a294c | 259 | } |
Rhyme | 0:be311b6a294c | 260 | break ; |
Rhyme | 0:be311b6a294c | 261 | case 2: |
Rhyme | 0:be311b6a294c | 262 | if (prevPage != page) { |
Rhyme | 2:ed52c8915226 | 263 | TFT.BusEnable(true) ; |
Rhyme | 0:be311b6a294c | 264 | TFT.background(Black) ; |
Rhyme | 0:be311b6a294c | 265 | TFT.foreground(White) ; |
Rhyme | 0:be311b6a294c | 266 | TFT.cls() ; |
Rhyme | 2:ed52c8915226 | 267 | TFT.BusEnable(false) ; |
Rhyme | 0:be311b6a294c | 268 | } |
Rhyme | 0:be311b6a294c | 269 | screen3() ; |
Rhyme | 0:be311b6a294c | 270 | wait(2) ; |
Rhyme | 0:be311b6a294c | 271 | break ; |
Rhyme | 0:be311b6a294c | 272 | default: |
Rhyme | 0:be311b6a294c | 273 | page = 0 ; |
Rhyme | 0:be311b6a294c | 274 | break ; |
Rhyme | 0:be311b6a294c | 275 | } |
Rhyme | 0:be311b6a294c | 276 | prevPage = page ; |
Rhyme | 0:be311b6a294c | 277 | |
MACRUM | 4:76d15fd29c9f | 278 | #if 0 |
Rhyme | 0:be311b6a294c | 279 | TSC.getRAWPoint(&x, &y, &z) ; |
Rhyme | 0:be311b6a294c | 280 | if ((x != 0)||(y != 0) || (z != 0)) { |
Rhyme | 0:be311b6a294c | 281 | if (x < 1000) { // left |
Rhyme | 0:be311b6a294c | 282 | decPage() ; |
Rhyme | 0:be311b6a294c | 283 | } else if (x > 3000) { // right |
Rhyme | 0:be311b6a294c | 284 | incPage() ; |
Rhyme | 0:be311b6a294c | 285 | } |
Rhyme | 0:be311b6a294c | 286 | } |
MACRUM | 4:76d15fd29c9f | 287 | #else |
MACRUM | 4:76d15fd29c9f | 288 | page++; |
MACRUM | 4:76d15fd29c9f | 289 | #endif |
MACRUM | 4:76d15fd29c9f | 290 | wait(1) ; |
Rhyme | 0:be311b6a294c | 291 | } |
Rhyme | 0:be311b6a294c | 292 | } |