| 전자부품 데이터시트 검색엔진 |
|
AN4545 데이터시트(PDF) 22 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4545 데이터시트(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. |
|
|
링크 URL |
| ALLDATASHEET 가 귀하에 도움이 되셨나요? [ DONATE ] |
Alldatasheet는? | 광고문의 | 운영자에게 연락하기 | 개인정보취급방침 | 링크 투 데이터시트 | 링크교환 | 제조사별 검색 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 |