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

Blocks: <xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="3[BMq}Bc4-P(:b-X{5-F">nb_ours</variable><variable id="Q)AkUfk(NoH9hTw[pjI7">capt_optique</variable></variables><block type="on_start" id="c8kK0C?nl:|bko.C!TX]" x="20" y="20"><statement name="DO"><block type="variables_set" id="uueli?T2!RS+HG)GkILe"><field name="VAR" id="3[BMq}Bc4-P(:b-X{5-F">nb_ours</field><value name="VALUE"><block type="math_number" id="u]5C3K)G`JKY9HJa)Z)E"><field name="NUM">0</field></block></value></block></statement></block><block type="forever" id="aRZu1,V+q8Z`gLP8U--$" x="10" y="180"><statement name="DO"><block type="variables_set" id="l`yy^5DFmcsM^EK%)X{z"><field name="VAR" id="Q)AkUfk(NoH9hTw[pjI7">capt_optique</field><value name="VALUE"><block type="call_expression_return" id="N,d-?_=!|8LR5g(fyb?j"><field name="NAME">p19</field><value name="chain"><block type="call_expression_editable_return" id="m^mBYqsJ3!jd7^Tt%1Dg"><field name="NAME">value</field></block></value></block></value><next><block type="controls_if" id="n0q_LuK$TH|U+_Xeob^#"><value name="IF0"><block type="logic_compare" id="t}G*CQ}A=SUEx#xF2c6d"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="Xb99J|F?V8vFjOT}55x9"><field name="VAR" id="Q)AkUfk(NoH9hTw[pjI7">capt_optique</field></block></value><value name="B"><block type="math_number" id="Xyq^v=@x;lWG1Y3sY8{1"><field name="NUM">1</field></block></value></block></value><statement name="DO0"><block type="variables_increment" id="}k~{!6i8rU|7[/#Yo{{y"><field name="VAR" id="3[BMq}Bc4-P(:b-X{5-F">nb_ours</field><value name="DELTA"><block type="math_number" id=",k+^c7YDUyAXoDPNUKFo"><field name="NUM">1</field></block></value><next><block type="communication_serialWrite" id="$cu!fHR@#?C@R_h`A_CH"><mutation newlines="false"></mutation><value name="TEXT"><block type="text_join_simple" id="iiX2mDf)`t/t}iivGcso"><mutation items="2"></mutation><value name="ADD0"><block type="text" id="fl0WHxdJ}dIxt/59#ZNW"><field name="TEXT">Ours detecte(s)=</field></block></value><value name="ADD1"><block type="variables_get" id="%E17feYQ#+kFK.2i=ZV|"><field name="VAR" id="3[BMq}Bc4-P(:b-X{5-F">nb_ours</field></block></value></block></value><next><block type="io_pause" id="}$UlIa$@ysn@flTv.k$O"><field name="UNIT">SEC</field><value name="TIME"><block type="math_number" id="$%1.20Jd%r`-mpU6:GYm"><field name="NUM">1</field></block></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

p19 = Pin(13, Pin.IN)
nb_ours=0

while True:
  capt_optique = p19.value()
  if capt_optique == 1:
    nb_ours = nb_ours + 1
    print('Ours detecte(s)='+str(nb_ours))
    utime.sleep(1)