| Electronic Components Datasheet Search |
|
AN4545 Datasheet(PDF) 21 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4545 Datasheet(HTML) 21 Page - STMicroelectronics |
|
21 / 27 page ![]() DocID026571 Rev 1 21/27 AN4545 Example code 27 /////////////////////////////////////////////////////////////////// int VL6180X_Init() { char reset; reset = ReadByte(0x016); if ( reset==1){ // check to see has it be Initialised already /////////////////////////////////////////////////////////////////// // Added latest settings here - see Section 8 /////////////////////////////////////////////////////////////////// WriteByte(0x016, 0x00); //change fresh out of set status to 0 } return 0; } /////////////////////////////////////////////////////////////////// // Start a range measurement in single shot mode /////////////////////////////////////////////////////////////////// int VL6180X_Start_Range() { WriteByte(0x018,0x01); return 0; } /////////////////////////////////////////////////////////////////// // poll for new sample ready ready /////////////////////////////////////////////////////////////////// int VL6180X_Poll_Range() { char status; char range_status; // check the status status = ReadByte(0x04f); range_status = status & 0x07; // wait for new measurement ready status while ( range_status != 0x04) { status = ReadByte(0x04f); range_status = status & 0x07; wait_ms(1); // (can be removed) } return 0; } /////////////////////////////////////////////////////////////////// // Read range result (mm) /////////////////////////////////////////////////////////////////// int VL6180X_Read_Range() { |
|
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 |