
"""


Auteur: anonyme

Interface: microbit

Nom du projet: radar de recul version n+1

Description: <span class="tooltip-title">radar de recul version n+1</span><span class="tooltip-author">Stéphanie Magonara</span><span class="tooltip-description"></span>

Toolbox: vittascience

Mode: mixed

Blocks: <xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="MyM$``);*goLOiQdjv7t">DISTANCE</variable></variables><block type="forever" id="o[WN]+eeF.OUxGch67@8" x="237" y="12"><statement name="DO"><block type="variables_set" id=".kHxU}#+u!J2nU?PY9U3"><field name="VAR" id="MyM$``);*goLOiQdjv7t">DISTANCE</field><value name="VALUE"><shadow type="math_number" id="cS]--PUsB]as/ErLc[{r"><field name="NUM">0</field></shadow><block type="sensors_getTemperature" id="34u)B:+s;DW^h,ZP9Z4t"><field name="UNIT">CELSIUS</field></block></value><next><block type="display_setNumberGrove4Digit" id="1!P09cX/=O9RcW9kV]+N"><field name="SHOW">TEMP</field><field name="CLK">pin0</field><field name="DIO">pin14</field><value name="N"><shadow type="math_number" id="}j)nM?PSaP^P=9!x?tHs"><field name="NUM">1024</field></shadow><block type="variables_get" id=",/ijmJ:]-bqYIC%#6fx%"><field name="VAR" id="MyM$``);*goLOiQdjv7t">DISTANCE</field></block></value><next><block type="io_pause" id="DOYJzM$;ESk:]sK5FM#("><field name="UNIT">SECOND</field><value name="TIME"><shadow type="math_number" id="$ZppfmN*vz3TP/BIP0xz"><field name="NUM">2</field></shadow></value><next><block type="display_setNumberGrove4Digit" id="17m8!!!IcVI43D-yBTjN"><field name="SHOW">TEMP</field><field name="CLK">pin0</field><field name="DIO">pin14</field><value name="N"><shadow type="math_number" id="uy0AW$112aVt:ZJoe@!K"><field name="NUM">0</field></shadow></value></block></next></block></next></block></next></block></statement></block><block type="on_start" id="G[=T#8yqB70`NFgYq}GP" deletable="false" x="-138" y="63"></block></xml>

Projet généré par Vittascience.

Ce fichier contient le code textuel ainsi que le code blocs. Il peut être importé de nouveau

sur l'interface http://vittascience.com/microbit


"""

from microbit import *
from tm1637 import TM1637
import utime

# 4 Digit Display CLK on pin0
# 4 Digit Display DIO on pin14
tm1637_0 = TM1637(clk=pin0, dio=pin14)

while True:
  DISTANCE = temperature()
  tm1637_0.temperature(int(DISTANCE))
  utime.sleep(2)
  tm1637_0.temperature(int(0))
