PixArt / Mbed OS OTS_P5101_Demo

Dependencies:   Pixart_OTS

Fork of OTS_P5101_Demo by Hill Chen

Files at this revision

API Documentation at this revision

Comitter:
PixArtHC
Date:
Tue Feb 26 19:04:53 2019 +0000
Child:
1:4c9b5b2f001e
Commit message:
PixArt Optical Finger Navigation, OFN, demo program for PAW3007 sensor with library. Initial release v1.0.

Changed in this revision

.gitignore Show annotated file Show diff for this revision Revisions of this file
Pixart_OFN.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.gitignore	Tue Feb 26 19:04:53 2019 +0000
@@ -0,0 +1,4 @@
+.build
+.mbed
+projectfiles
+*.py*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Pixart_OFN.lib	Tue Feb 26 19:04:53 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/PixArtHC/code/Pixart_OFN/#a4065043fd57
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Feb 26 19:04:53 2019 +0000
@@ -0,0 +1,41 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2018 ARM Limited
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/* ADBM-A350: Finger navigation chip.
+ * By PixArt Imaging Inc.
+ * Primary Engineer: Hill Chen (PixArt USA)
+ *
+ * License: Apache-2.0; http://www.apache.org/licenses/LICENSE-2.0
+ */
+ 
+/* Revision History
+ * V1.0: February 25, 2019
+ * First release.
+ */
+
+
+#include "mbed.h"
+#include "Pixart_OFN.h"
+
+Serial  pc(USBTX, USBRX);
+I2C i2c(I2C_SDA0, I2C_SCL0);
+
+// main() runs in its own thread in the OS
+int main()
+{
+    bool Result = false;
+    Pixart_OFN *m_Sensor = new Pixart_OFN(&i2c, &pc, 0.25f, Result);
+    if(Result)  pc.printf("\r\n\n %s %s initialization successfully\r\n", PRODUCT, MODEL);
+    else{       pc.printf("\r\n\n %s %s fail on initialization", PRODUCT, MODEL);
+        while (true)    ;
+    }
+
+    while (true){
+#ifndef USE_CALLBACK          
+        m_Sensor->periodicCallback();
+        wait_ms(250);
+#endif        
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Tue Feb 26 19:04:53 2019 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#bc132a6066cafdb9e4028251b5aff7cfcbcaa444