viernes, 18 de marzo de 2011

Testeamos el sensor de luz

'En este programa testeamos el valor del sensor de luz.
'En función del intervalo de intensidad donde se encuentre visualiza
'un número del 0 al 9

main:

low 7,6,5,4,3,2,1,0
readadc 2,b0

if b0 > 150 then nueve
if b0 > 135 then ocho
if b0 > 120 then siete
if b0 > 105 then seis
if b0 > 90 then cinco
if b0 > 75 then cuatro
if b0 > 60 then tres
if b0 > 45 then dos
if b0 > 30 then uno
if b0 < 30 then cero

goto main

nueve:
high 6,5,2,1,0
goto main

ocho:
high 6,5,4,3,2,1,0
goto main

siete:
high 2,1,0
goto main

seis:
high 6,5,4,3,2
goto main

cinco:
high 6,5,3,2,0
goto main

cuatro:
high 6,5,2,1
goto main

tres:
high 6,3,2,1,0
goto main

dos:
high 6,4,3,1,0
goto main

uno:
high 1,2
goto main

cero:
high 5,4,3,2,1,0
goto main

No hay comentarios:

Publicar un comentario