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

Blocks: <xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="U=j~xB}~A}r3$#eXwxrc">capt_optique</variable></variables><block type="on_start" id="G[=T#8yqB70`NFgYq}GP" deletable="false" x="0" y="0"><statement name="DO"><block type="display_galaxia_set_mode" id="$nG,r=LZ|%/1tg#`7lLd"><field name="MODE">plot.show</field><next><block type="display_galaxia_plot_set_y_scale" id="c3ZB=e.KLI`#dLn}QYcs"><value name="MIN"><shadow type="math_number" id="ED5jp}Gt.T82aEOV@O!E"><field name="NUM">0</field></shadow></value><value name="MAX"><shadow type="math_number" id="#,O{#:78RETr%(Z^b[cJ"><field name="NUM">1.5</field></shadow></value></block></next></block></statement></block><block type="forever" id="o[WN]+eeF.OUxGch67@8" x="512" y="63"><statement name="DO"><block type="variables_set" id="W:*g#%Aj$kxR:v)@;BV)"><field name="VAR" id="U=j~xB}~A}r3$#eXwxrc">capt_optique</field><value name="VALUE"><shadow type="math_number" id="6l!b]7p5v8_(ubS`Nsga"><field name="NUM">0</field></shadow><block type="sensors_getGroveLineFinder" id="PSnjnwApl;hP=GPa?i6l"><field name="PIN">p13</field></block></value><next><block type="io_pause" id="YOS=Hr^URDGvi5u1icSV"><field name="UNIT">MILLI</field><value name="TIME"><shadow type="math_number" id="m:m0:5^ey:0]O7h=sb]/"><field name="NUM">200</field></shadow></value><next><block type="display_galaxia_plot_add_point" id="ET{GvBLjhp]o,7S$5iR^"><value name="POINT"><shadow type="math_number" id="e9fdo5%w9vqaG?}V=z7`"><field name="NUM">50</field></shadow><block type="variables_get" id="_]9=JE;EoOtiqcaiX%*m"><field name="VAR" id="U=j~xB}~A}r3$#eXwxrc">capt_optique</field></block></value><next><block type="display_galaxia_raw_rect" id="Bu0}ZlKfqfGr;TK;++8z"><value name="X"><shadow type="math_number" id="#P!Ce`6C0OVCOSDPsi1I"><field name="NUM">0</field></shadow></value><value name="Y"><shadow type="math_number" id="d,:pYo:V{#!!(h[frj}]"><field name="NUM">0</field></shadow></value><value name="W"><shadow type="math_number" id="W75}Cz;3Tqt8dI*lkZ`*"><field name="NUM">120</field></shadow></value><value name="H"><shadow type="math_number" id="v:sn7.F%a*(}`fe0IACQ"><field name="NUM">30</field></shadow></value><value name="COLOR"><block type="colour_picker" id=")A|Yi2`C5@3($5KUT|1}"><field name="COLOUR">#000000</field></block></value><next><block type="display_galaxia_raw_print" id=":#yv?1dn8@$C~eH]r8y6"><value name="TEXT"><shadow type="text" id="h[.Gr6u`}?Z/{hjKUr3u"><field name="TEXT">capt</field></shadow><block type="text_join" id="/3_tsJ2A|,kVk(RBYyW/"><mutation items="2"></mutation><value name="ADD0"><block type="text" id="+[$1Y#-w@~^KnFpxvc@L"><field name="TEXT">Capteur_optique=</field></block></value><value name="ADD1"><block type="variables_get" id="MTq,bl8t0dyANM,|ZkP6"><field name="VAR" id="U=j~xB}~A}r3$#eXwxrc">capt_optique</field></block></value></block></value><value name="X"><shadow type="math_number" id="CA0ICHoog5^^UOh{zvKf"><field name="NUM">0</field></shadow></value><value name="Y"><shadow type="math_number" id="`jgDL7VLRtByQf!t{!ib"><field name="NUM">0</field></shadow></value></block></next></block></next></block></next></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

# Line Finder on p13
p19 = Pin(13, Pin.IN)

display.plot.show()
display.plot.set_y_scale(0,1.5)

while True:
  capt_optique = p19.value()
  utime.sleep_ms(200)
  display.plot.add_point(capt_optique)
  rect = display.raw.Rect(0, 0, 120, 30, 0x000000)
  rect.show(True)
  display.raw.print(0, 0, 'Capteur_optique=' + str(capt_optique))
