From e800bc42e811087efc35350d5bfaa97cd1926d88 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sun, 17 Dec 2006 19:07:28 +0000 Subject: [PATCH] =?utf8?q?El=20sensor=20ahora=20devuelve=20valor=20binario?= =?utf8?q?=20(0=20si=20no=20tiene=20nada=20adelante,=201=20si=20s=C3=AD=20?= =?utf8?q?tiene).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- trunk/src/breve/Celdas.tz | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/trunk/src/breve/Celdas.tz b/trunk/src/breve/Celdas.tz index 0d3ced5..ce5d511 100644 --- a/trunk/src/breve/Celdas.tz +++ b/trunk/src/breve/Celdas.tz @@ -211,10 +211,10 @@ CeldasLightVehicle : CeldasVehicle (aka CeldasVehicles) { return (fSensor get-sensor-value). +to update-entorno: - entorno{"sensor_f"} = (fSensor get-data). - entorno{"sensor_b"} = (bSensor get-data). - entorno{"sensor_r"} = (rSensor get-data). - entorno{"sensor_l"} = (lSensor get-data). + entorno{"sensor_f"} = (fSensor get-sensor-value). + entorno{"sensor_b"} = (bSensor get-sensor-value). + entorno{"sensor_r"} = (rSensor get-sensor-value). + entorno{"sensor_l"} = (lSensor get-sensor-value). entorno{"movido"} = 0. # TODO sa update-entorno with entorno. @@ -523,6 +523,11 @@ Link : CeldasSensor (aka CeldasSensors) { % Gets the sensor value. This should be used from post-iterate, % if not, the sensor reading correspond to the previous % iteration. + val (float). + + val = self get-data. + if (val > 10): return 0. + else return 1. #+ to iterate: -- 2.43.0