[table id=2 /]
[codesyntax lang= »python »]
import smbus import time bus=smbus.SMBus(1) addr=0x62 while True: bus.write_byte_data(0x62,0x00, 0x04) val_high=bus.read_byte_data(0x62,0x0f) val_low=bus.read_byte_data(0x62,0x10) dist_cm=val_high*256+val_low print `dist_cm` + " cm " time.sleep(1)
[/codesyntax]
Maj 22/12/2018
J’ai du réinstaller le Pi 0 W et le lidar ne fonctionnait plus. Faire :
https://github.com/raspberrypi/firmware/issues/828
- Download the old module here.
- Copy this file into
/boot/overlays
. - In
/boot/config.txt
add the linedtoverlay=i2c1-bcm2708
at the end.