Hover! test program.

Dependencies:   MjHover mbed

Revision:
0:6f474427ba37
Child:
1:514827ffb84a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Apr 02 13:03:11 2015 +0000
@@ -0,0 +1,41 @@
+#include "mbed.h"
+#include "MjHover.h"
+
+using namespace matsujirushi;
+
+Serial pc(USBTX, USBRX);
+
+I2C i2c(p28, p27);
+DigitalInOut hover_ts(p21);
+DigitalInOut hover_reset_n(p22);
+
+MjHover hover(&i2c, 0x84, &hover_ts, &hover_reset_n);
+
+int main()
+{
+    pc.baud(115200);
+    i2c.frequency(100000);
+    
+    pc.printf("Start\r\n");
+    
+    hover.begin();
+    
+    for(;;)
+    {
+        if (hover.getStatus() == false)
+        {
+            uint8_t event = hover.getEvent();
+            hover.setRelease();
+            
+            const char* output_string = hover.getEventString(event);
+            if (event != 0)
+            {
+                pc.printf("%02x:[%s]\r\n", event, hover.getEventString(event));
+            }
+        }
+    }
+}
+
+
+
+