X-Git-Url: https://git.llucax.com/z.facultad/75.68/celdas.git/blobdiff_plain/865e61e603e69bd8211086a8a0b0be7a424facbe..18717ab1d13c9af9ed7f4e85fd26c27634483c4f:/trunk/src/breve/Demo.tz?ds=sidebyside 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.