| Electronic Components Datasheet Search |
|
AN4545 Datasheet(PDF) 22 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4545 Datasheet(HTML) 22 Page - STMicroelectronics |
|
22 / 27 page ![]() Example code AN4545 22/27 DocID026571 Rev 1 int range; range=ReadByte(0x062); return range; } /////////////////////////////////////////////////////////////////// // clear interrupts /////////////////////////////////////////////////////////////////// int VL6180X_Clear_Interrupts() { WriteByte(0x015,0x07); return 0; } /////////////////////////////////////////////////////////////////// // Main Program loop /////////////////////////////////////////////////////////////////// int main() { int range; // load settings onto VL6180X VL6180X_Init(); while ( 1){ // start single range measurement VL6180X_Start_Range(); // poll the VL6180X till new sample ready VL6180X_Poll_Range(); // read range result range = VL6180X_Read_Range(); // clear the interrupt on VL6180X VL6180X_Clear_Interrupts(); // send range to pc by serial pc.printf("%d\r\n", range); wait(0.1); } } To change the example above to continuous mode: 1. In the VL6180X_Start_Range() function change the data written to VL6180X from 0x01 to 0x03. 2. In the while loop, move the function call for VL6180X_Start_Range() to outside the while loop, immediately after the VL6180X_Init() call. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |