X-Git-Url: https://git.llucax.com/z.facultad/75.68/celdas.git/blobdiff_plain/865e61e603e69bd8211086a8a0b0be7a424facbe..d90679c0ecd281886d46682ec8831a2ac2e43021:/trunk/src/breve/Demo.tz diff --git a/trunk/src/breve/Demo.tz b/trunk/src/breve/Demo.tz index 1fe9eb1..7794c3d 100644 --- a/trunk/src/breve/Demo.tz +++ b/trunk/src/breve/Demo.tz @@ -34,14 +34,12 @@ CeldasControl : DemoController { value = sensor get-sensor-value. - if value < 2: { - leftWheel set-velocity to ((leftWheel get-velocity) + 1). - rightWheel set-velocity to ((rightWheel get-velocity) + 1). - } - - if value > 2: { - leftWheel set-velocity to ((leftWheel get-velocity) - 1). - rightWheel set-velocity to ((rightWheel get-velocity) - 1). + if value < 1: { + leftWheel set-velocity to ((leftWheel get-velocity) + 15). + rightWheel set-velocity to ((rightWheel get-velocity) + 15). + } else if value > 10: { + leftWheel set-velocity to ((leftWheel get-velocity) - 15). + rightWheel set-velocity to ((rightWheel get-velocity) - 15). } print value.