..
Dependencies: ID12RFID TFTLCD mbed
Revision 2:b0edfc6c035a, committed 2013-02-01
- Comitter:
- allanalpha
- Date:
- Fri Feb 01 17:46:41 2013 +0000
- Parent:
- 1:508738693b81
- Child:
- 3:cbbfd06fa9b4
- Commit message:
- thgf
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| touchpad.lib | Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Feb 01 15:25:18 2013 +0000
+++ b/main.cpp Fri Feb 01 17:46:41 2013 +0000
@@ -2,9 +2,40 @@
#include "ID12RFID.h"
#include "hx8340bs.h"
+
ID12RFID rfid(p10); // uart rx
HX8340S_LCD lcd( p9, p14, p13, p11 ); //Screen initialization
// HX8340S_LCD( PinName CS, PinName RESET, PinName SCL, PinName SDI, PinName BL = NC, backlight_t blType = Constant, float defaultBackLightLevel = 1.0 );
+
+int ReadX(PinName x1, PinName x2, PinName y1, PinName y2){
+
+ int tempX;
+ DigitalOut X1(x1);
+ DigitalOut X2(x2);
+ AnalogIn Y1(y1);
+ AnalogIn Y2(y2);
+
+ X1=1;
+ X2=0;
+ tempX=Y2;
+
+ return tempX;
+ }
+
+
+int ReadY(PinName x1, PinName x2, PinName y1, PinName y2){
+ int tempY;
+ DigitalOut X1(X1);
+ DigitalOut X2(X2);
+ AnalogIn Y1(y1);
+ AnalogIn Y2(y2);
+
+ X1=1;
+ X2=0;
+ tempY=Y1;
+
+ return tempY;
+ }
int main() {
@@ -12,9 +43,9 @@
// initialize display - place it in standard portrait mode and set background to black and
// foreground to white color.
lcd.Initialize();
- lcd.FillScreen(COLOR_CYAN);
+ lcd.FillScreen(COLOR_RED);
lcd.SetBackground(COLOR_BLUE);
- lcd.DrawRoundRect(20,20,60,60,COLOR_RED);
+ lcd.DrawRoundRect(20,20,60,60,COLOR_GREEN);
// set current font to the smallest 8x12 pixels font.
//lcd.SetFont( TerminusFont );
// print something on the screen
@@ -24,5 +55,16 @@
if(rfid.readable()) {
printf("RFID Tag number : %d\n", rfid.read());
}
+ if (ReadX(p15,p17,p18,p16)){
+ printf("X Coordinate : %d\n", ReadX(p15,p17,p18,p16));
+ }
}
-}
\ No newline at end of file
+}
+
+
+
+
+
+
+
+
\ No newline at end of file
--- a/touchpad.lib Fri Feb 01 15:25:18 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/allanalpha/code/touchpad/#ff5187998c84