Electronic Components Datasheet Search
  English  ▼

X  

AN4545 Datasheet(PDF) 22 Page - STMicroelectronics

Part # AN4545
Description  VL6180X basic ranging application note
PDF  27 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN4545 Datasheet(HTML) 22 Page - STMicroelectronics

Back Button AN4545 Datasheet HTML 18Page - STMicroelectronics AN4545 Datasheet HTML 19Page - STMicroelectronics AN4545 Datasheet HTML 20Page - STMicroelectronics AN4545 Datasheet HTML 21Page - STMicroelectronics AN4545 Datasheet HTML 22Page - STMicroelectronics AN4545 Datasheet HTML 23Page - STMicroelectronics AN4545 Datasheet HTML 24Page - STMicroelectronics AN4545 Datasheet HTML 25Page - STMicroelectronics AN4545 Datasheet HTML 26Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 22 / 27 page
background image
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.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27


Datasheet Download

Go To PDF Page


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


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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