PixArt Optical Track Sensor, OTS, demo program for P5101 sensor with OTS library v1.1. Imported and modified from P9130 demo program. Initial release v1.0.

Dependencies:   Pixart_OTS

Fork of OTS_P5101_Demo by Hill Chen

Revision:
6:935148896ccf
Parent:
5:1633d262b22f
diff -r 1633d262b22f -r 935148896ccf main.cpp
--- a/main.cpp	Wed Mar 06 21:25:04 2019 +0000
+++ b/main.cpp	Tue Mar 26 22:50:31 2019 +0000
@@ -3,7 +3,7 @@
  * SPDX-License-Identifier: Apache-2.0
  */
 
-/* PAT9130EW: Optical Tracking Sensor.
+/* PAA5101EW: Optical Tracking Sensor.
  * By PixArt Imaging Inc.
  * Primary Engineer: Hill Chen (PixArt USA)
  *
@@ -11,7 +11,7 @@
  */
  
 /* Demo Code Revision History
- * V1.0: March 6, 2019
+ * V1.0: March 26, 2019
  * First release.
  */
 
@@ -21,14 +21,15 @@
 Serial  pc(USBTX, USBRX);
 SPI spi(p23, p24, p25); //mosi, miso, sclk
 DigitalOut cs(p22);     //chip select
+DigitalOut ldp_enl_pin(p20);//laser diode control, low enable
 
-static const Pixart_OTS_Model OTS_MODEL = PIXART_OTS_MODEL_9130;
+static const Pixart_OTS_Model OTS_MODEL = PIXART_OTS_MODEL_5101;
 
 int main()
 {
     pc.baud(115200);
 
-    Pixart_OTS *pixart_ots = create_pixart_ots(OTS_MODEL, pc, spi, cs);
+    Pixart_OTS *pixart_ots = create_pixart_ots(OTS_MODEL, pc, spi, cs, ldp_enl_pin);
 
     if (!pixart_ots)
     {