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.
Dependencies: mbed TS_STMPE811 GLCD_MCB1700
Diff: main.cpp
- Revision:
- 0:f9cee437ca54
- Child:
- 1:eb377b26b700
diff -r 000000000000 -r f9cee437ca54 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Mar 12 11:58:22 2012 +0000
@@ -0,0 +1,78 @@
+#include "mbed.h"
+#include "TS.h"
+#define TFT 1
+DigitalOut led1(P1_28);
+DigitalOut led2(P4_28);
+DigitalOut led3(P1_31);
+InterruptIn event(P0_5);//P0_5 INT_TS
+int x,y,z;
+void isr_TSF(void)
+{
+ led2 = !led2;
+ TS_Write (TS_INT_STA, 0xFF);
+}
+int main() {
+ //init GLCD
+#ifdef TFT
+ GLCD_Init();
+ GLCD_Clear (White);
+ GLCD_DisplayString (0, 0, 1, (unsigned char *)"QEI HARDWARE MOTOR");
+
+#endif
+led3=0;
+event.mode(PullUp); //PULL-UP
+if(TS_Init ())
+ led2=1;
+wait(1);
+event.fall(&isr_TSF);
+ while(1) {
+ }
+}
+#include "mbed.h"
+#include "TS.h"
+#include "GLCD_MCB1700.h"
+#define TFT 1
+DigitalOut led1(P1_28);
+DigitalOut led2(P1_29);
+DigitalOut led3(P1_31);
+InterruptIn event(P0_5);//P0_5 INT_TS
+int x,y,z;
+void isr_TSF(void)
+{
+
+ led3 = 1;
+
+ TS_Write (TS_INT_STA, 0xFF);
+
+ led3 = 0;
+}
+int main() {
+ //init GLCD
+#ifdef TFT
+ GLCD_Init();
+ GLCD_Clear (White);
+ GLCD_DisplayString (0, 0, 1, (unsigned char *)"STMPE811");
+
+#endif
+led1=0;
+led2=0;
+led3=0;
+event.mode(PullUp); //PULL-UP
+if(TS_Init ())
+ led2=1;
+wait(1);
+//event.fall(&isr_TSF);
+ while(1) {
+ if(TS_Read (TS_INT_STA, 1)&7){
+ led1=1;
+ ts_XY( &x,&y,&z);
+ char text[32];
+ sprintf(text," ");
+ GLCD_DisplayString (1, 0, 1, (unsigned char *)text);
+ sprintf(text,"x:%d y:%d z:%d ", x,y,z);
+ GLCD_DisplayString (1, 0, 1, (unsigned char *)text);
+ TS_Write (TS_INT_STA, 0xFF);
+ led1=0;
+ }
+ }
+}