Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package jBotBrain2.Test;
- import jBotBrain2.hw.*;
- import jBotBrain2.sensors.UltraSonicRangeFinder;
- public class TestMain {
- public static void main(String[] args) throws InterruptedException {
- Led.GREEN1.set(Led.MODE_BLINK, 100);
- UltraSonicRangeFinder us = new UltraSonicRangeFinder();
- System.out.println("Hello :)");
- boolean i = true;
- while (true) {
- System.out.print("US="+us.getDistance()+" \r");
- if (i) {
- Led.ORANGE.on();
- i = false;
- } else {
- Led.ORANGE.off();
- i = true;
- }
- Thread.sleep(200);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement