"""
Interface: galaxia
Nom du projet: Nouveau projet
Description: 
Toolbox: vittascience
Mode: blocks

Blocks: <xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="7L4@aqt{d*tUJm_X4j.:">capt_optique</variable></variables><block type="on_start" id="G[=T#8yqB70`NFgYq}GP" deletable="false" x="63" y="13"><statement name="DO"><block type="io_initChronometer" id="}nkPvHX{INn!^22I^h#C"></block></statement></block><block type="forever" id="o[WN]+eeF.OUxGch67@8" x="63" y="188"><statement name="DO"><block type="variables_set" id="KCD]6$M[Zuhtt(M]A!;v"><field name="VAR" id="7L4@aqt{d*tUJm_X4j.:">capt_optique</field><value name="VALUE"><shadow type="math_number" id="4oA;MG%%gRe!LtZBm:Q8"><field name="NUM">0</field></shadow><block type="io_readDigitalPin" id="yCaTuh*64,faD^9hH%A1"><field name="PIN">p13</field></block></value><next><block type="controls_if" id="~3p_{~~+H}^NhX_~3ijc"><value name="IF0"><block type="logic_compare" id="Br:qg$%J391x@72plr^2"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="|l0{lzg$fMJjO@~i.u{D"><field name="VAR" id="7L4@aqt{d*tUJm_X4j.:">capt_optique</field></block></value><value name="B"><shadow type="math_number" id="Z}Gh,Tp4InIBa8pRTU|1"><field name="NUM">1</field></shadow></value></block></value><statement name="DO0"><block type="display_galaxia_screen_set_text" id="1Im5Rtf+.dV:OGv;*Qeb"><value name="TEXT"><shadow type="text" id="u~+bY{67;Fzq}pV}mC3{"><field name="TEXT">Ours present</field></shadow></value><next><block type="display_galaxia_screen_set_text" id="{{xn[R,rSEGG.|q:$25_"><value name="TEXT"><shadow type="text" id="HkOL2/$!5$ldeW6b65Q8"><field name="TEXT">Bonjour</field></shadow><block type="math_round" id="JQ!GoHCW{KNo{Z!d.^@_"><field name="OP">ROUND</field><value name="NUM"><shadow type="math_number" id="L9Wk@LAsuU7X/h#I8570" disabled="true"><field name="NUM">3.1</field></shadow><block type="io_getChronometer" id="IxG$tR/$6uu4b!4VPu0p"><field name="UNIT">SEC</field></block></value></block></value><next><block type="io_pause" id="*W^zohaL(A8[]}Go5N#u"><field name="UNIT">SEC</field><value name="TIME"><shadow type="math_number" id="?^??_Ky*tbTG^L3]PwO~"><field name="NUM">1</field></shadow></value></block></next></block></next></block></statement></block></next></block></statement></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/galaxia

"""

from machine import *
from thingz import *
import utime
import math

t0 = utime.ticks_ms()

p19 = Pin(13, Pin.IN)

while True:
  capt_optique = p19.value()
  if capt_optique == 1:
    print('Ours present')
    print(str(round(utime.ticks_diff(utime.ticks_ms(), t0)/1e3)))
    utime.sleep(1)
