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.
Dependents: LPC1768_Mini-DK_EasyWeb_DM9161 LPC1768_Mini-DK LPC1768_Mini-DK
Fork of Mini-DK by
Diff: TouchADS7843/Touch.cpp
- Revision:
- 17:66c4e84d8571
- Parent:
- 8:9517c10e40d2
- Child:
- 20:5feb12e3801f
--- a/TouchADS7843/Touch.cpp Tue Jan 08 17:39:50 2013 +0000 +++ b/TouchADS7843/Touch.cpp Wed Jan 09 20:54:35 2013 +0000 @@ -17,17 +17,6 @@ #include "mbed.h" #include "Arial12x12.h" -/*Coordinate ScreenSample[3] = { - { 45, 45 }, - { 45, 270}, - { 190,190} -} ;*/ -/*Coordinate DisplaySample[3] = { - { 45, 45 }, - { 45, 270}, - { 190,190} -} ;*/ - #define THRESHOLD 2 TouchScreenADS7843::TouchScreenADS7843(PinName tp_mosi, PinName tp_miso, PinName tp_sclk, PinName tp_cs, PinName tp_irq, SPI_TFT *_LCD) @@ -60,14 +49,14 @@ wait_us(SPI_RD_DELAY); _tp_spi.write(XY); wait_us(SPI_RD_DELAY); - msb = _tp_spi.write(0x00); // msb + msb = _tp_spi.write(0x00); // msb wait_us(SPI_RD_DELAY); - lsb = _tp_spi.write(0x00); // lsb + lsb = _tp_spi.write(0x00); // lsb _tp_cs=1; Temp = ((msb << 8 ) | lsb); Temp >>= 3; Temp &= 0xfff; - Temp /= 4; // Scaling : return value range must be between 0 and 1024 + Temp /= 4; // Scaling : return value range must be between 0 and 1024 return(Temp); }