Download Inhoudsopgave Inhoud Print deze pagina

Joy-IT EXPLORER SET RB-P-XPLR-SET Handleiding pagina 19

Inhoudsopgave

Advertenties

# Now the distance is calculated using the recorded time
distance
=
pulse_duration
*
17165
distance
=
round(distance, 0)
# Serial output
print
('Distance:',"{:.0f}".format(distance),'cm')
time.sleep(1)
# Adjust measured value to LCD height
if(distance
>
100):
distance
=
100
drawHeight
=
round(translate(distance, 0, 100, 0, 160))
# Fill the TFT display
lcd.fill_screen(lcd.rgb_to_565(255, 255, 255))
lcd.draw_block(0, 0, 128, drawHeight, lcd.rgb_to_565(0, 255, 0))
/
1000000
Berekening van het waardebereik
en beschrijving van het TFT-scherm
19

Advertenties

Inhoudsopgave
loading

Inhoudsopgave