PixArt Optical Finger Navigation, OFN, demo program for A350 sensor with library. Alternative porting style in C++. Initial release v1.0.
Dependencies: Pixart_OFN_A
Fork of OFN_A350_Demo by
main.cpp@2:4c248212e354, 2019-02-27 (annotated)
- Committer:
- PixArtHC
- Date:
- Wed Feb 27 21:16:38 2019 +0000
- Revision:
- 2:4c248212e354
- Parent:
- 1:67d6484416a6
PixArt Optical Finger Navigation, OFN, demo program for A350 sensor with library. Alternative porting style in C++. Initial release v1.0.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
PixArtHC | 2:4c248212e354 | 1 | /* mbed Microcontroller Library |
PixArtHC | 2:4c248212e354 | 2 | * Copyright (c) 2018 ARM Limited |
PixArtHC | 2:4c248212e354 | 3 | * SPDX-License-Identifier: Apache-2.0 |
PixArtHC | 2:4c248212e354 | 4 | */ |
PixArtVY | 0:a051df82fcdf | 5 | |
PixArtHC | 2:4c248212e354 | 6 | /* ADBM-A350: Finger navigation chip. |
PixArtHC | 2:4c248212e354 | 7 | * By PixArt Imaging Inc. |
PixArtHC | 2:4c248212e354 | 8 | * Primary Engineer: Hill Chen (PixArt USA) |
PixArtHC | 2:4c248212e354 | 9 | * |
PixArtHC | 2:4c248212e354 | 10 | * License: Apache-2.0; http://www.apache.org/licenses/LICENSE-2.0 |
PixArtHC | 2:4c248212e354 | 11 | */ |
PixArtHC | 2:4c248212e354 | 12 | |
PixArtHC | 2:4c248212e354 | 13 | /* Revision History |
PixArtHC | 2:4c248212e354 | 14 | * V1.0: February 27, 2019 |
PixArtHC | 2:4c248212e354 | 15 | * First release. |
PixArtHC | 2:4c248212e354 | 16 | */ |
PixArtVY | 1:67d6484416a6 | 17 | |
PixArtVY | 1:67d6484416a6 | 18 | |
PixArtHC | 2:4c248212e354 | 19 | #include "mbed.h" |
PixArtHC | 2:4c248212e354 | 20 | #include "Pixart_OFN.h" |
PixArtVY | 1:67d6484416a6 | 21 | |
PixArtHC | 2:4c248212e354 | 22 | Serial pc(USBTX, USBRX); |
PixArtHC | 2:4c248212e354 | 23 | I2C i2c(I2C_SDA0, I2C_SCL0); |
PixArtVY | 0:a051df82fcdf | 24 | |
PixArtHC | 2:4c248212e354 | 25 | // main() runs in its own thread in the OS |
PixArtVY | 0:a051df82fcdf | 26 | int main() |
PixArtVY | 0:a051df82fcdf | 27 | { |
PixArtHC | 2:4c248212e354 | 28 | bool Result = false; |
PixArtHC | 2:4c248212e354 | 29 | Pixart_OFN *m_Sensor = new Pixart_OFN(&i2c, &pc, 0.25f, Result); |
PixArtHC | 2:4c248212e354 | 30 | if(Result) pc.printf("\r\n\n %s %s initialization successfully\r\n", PRODUCT, MODEL); |
PixArtHC | 2:4c248212e354 | 31 | else{ pc.printf("\r\n\n %s %s fail on initialization", PRODUCT, MODEL); |
PixArtHC | 2:4c248212e354 | 32 | while (true) ; |
PixArtHC | 2:4c248212e354 | 33 | } |
PixArtVY | 0:a051df82fcdf | 34 | |
PixArtHC | 2:4c248212e354 | 35 | while (true){ |
PixArtHC | 2:4c248212e354 | 36 | #ifndef USE_CALLBACK |
PixArtHC | 2:4c248212e354 | 37 | m_Sensor->periodicCallback(); |
PixArtHC | 2:4c248212e354 | 38 | wait_ms(250); |
PixArtHC | 2:4c248212e354 | 39 | #endif |
PixArtVY | 0:a051df82fcdf | 40 | } |
PixArtVY | 0:a051df82fcdf | 41 | } |