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: Pixart_OTS
Fork of OTS_P5101_Demo by
Revision 4:1b406caf9581, committed 2019-03-06
- Comitter:
- PixArtHC
- Date:
- Wed Mar 06 21:17:05 2019 +0000
- Parent:
- 3:773e5dc2c379
- Child:
- 5:1633d262b22f
- Commit message:
- PixArt Optical Track Sensor, OTS, demo program for P9125 sensor with library. Imported and modified from P9125 demo program. Initial release v1.0.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Mar 06 21:04:45 2019 +0000
+++ b/main.cpp Wed Mar 06 21:17:05 2019 +0000
@@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
-/* PAT9126JA: Optical Tracking Sensor.
+/* PAT9125EL: Optical Tracking Sensor.
* By PixArt Imaging Inc.
* Primary Engineer: Hill Chen (PixArt USA)
*
@@ -19,15 +19,16 @@
#include "Pixart_OTS.h"
Serial pc(USBTX, USBRX);
-I2C i2c(I2C_SDA0, I2C_SCL0);
+SPI spi(p23, p24, p25); //mosi, miso, sclk
+DigitalOut cs(p22); //chip select
-static const Pixart_OTS_Model OTS_MODEL = PIXART_OTS_MODEL_9126;
+static const Pixart_OTS_Model OTS_MODEL = PIXART_OTS_MODEL_9125;
int main()
{
pc.baud(115200);
- Pixart_OTS *pixart_ots = create_pixart_ots(OTS_MODEL, pc, i2c);
+ Pixart_OTS *pixart_ots = create_pixart_ots(OTS_MODEL, pc, spi, cs);
if (!pixart_ots)
{
