From ac17d2ffa63ae9c6ac5b5b9b38afe62c160d335c Mon Sep 17 00:00:00 2001 From: kleiinnn Date: Sun, 8 Sep 2013 12:01:28 +0200 Subject: [PATCH] fixed msleep problems in ServoExample --- examples/Servo/ServoExample.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/Servo/ServoExample.java b/examples/Servo/ServoExample.java index 6156d33..5b069aa 100644 --- a/examples/Servo/ServoExample.java +++ b/examples/Servo/ServoExample.java @@ -14,21 +14,22 @@ public static void main(String[] agrs){ AnalogSensor sensor = new AnalogSensor(0); Servo servo = new Servo(0); servo.enable(); + Controller c = new Controller(); while(true){ System.out.println("Place sensor!"); - Controller.msleep(1000); + c.msleep(1000); int currentVal = sensor.getValue(); System.out.println(currentVal); if(currentVal > 600){ servo.setPosition(2000); - Controller.msleep(500); + c.msleep(500); } else{ servo.setPosition(0); - Controller.msleep(500); + c.msleep(500); } servo.setPosition(1000); - Controller.msleep(500); + c.msleep(500); } } } \ No newline at end of file