PixArt Optical Finger Navigation, OFN, demo program for PAW3007 sensor with library. Initial release v1.0.
Dependencies: Pixart_OFN
Fork of OFN_P3007_Demo by
main.cpp
00001 /* mbed Microcontroller Library 00002 * Copyright (c) 2018 ARM Limited 00003 * SPDX-License-Identifier: Apache-2.0 00004 */ 00005 00006 /* PAW3007: Finger navigation chip. 00007 * By PixArt Imaging Inc. 00008 * Primary Engineer: Hill Chen (PixArt USA) 00009 * 00010 * License: Apache-2.0; http://www.apache.org/licenses/LICENSE-2.0 00011 */ 00012 00013 /* Revision History 00014 * V1.1: February 26, 2019 00015 * Modify typo in comments. 00016 * 00017 * V1.0: February 25, 2019 00018 * First release. 00019 */ 00020 00021 00022 #include "mbed.h" 00023 #include "Pixart_OFN.h" 00024 00025 Serial pc(USBTX, USBRX); 00026 I2C i2c(I2C_SDA0, I2C_SCL0); 00027 00028 // main() runs in its own thread in the OS 00029 int main() 00030 { 00031 bool Result = false; 00032 Pixart_OFN *m_Sensor = new Pixart_OFN(&i2c, &pc, 0.25f, Result); 00033 if(Result) pc.printf("\r\n\n %s %s initialization successfully\r\n", PRODUCT, MODEL); 00034 else{ pc.printf("\r\n\n %s %s fail on initialization", PRODUCT, MODEL); 00035 while (true) ; 00036 } 00037 00038 while (true){ 00039 #ifndef USE_CALLBACK 00040 m_Sensor->periodicCallback(); 00041 wait_ms(250); 00042 #endif 00043 } 00044 }
Generated on Sun Jul 17 2022 06:29:04 by 1.7.2