Skip to content

Instantly share code, notes, and snippets.

@DapperFox
Created May 20, 2014 22:42
Show Gist options
  • Save DapperFox/71d11f5883259cc8274c to your computer and use it in GitHub Desktop.
Save DapperFox/71d11f5883259cc8274c to your computer and use it in GitHub Desktop.
Thread LejosTest
package learnlejos;
import lejos.nxt.*;
/**
* Created by blakebishop on 5/6/14.
*/
public class ThreadTest {
public static void main(String[] args) {
// TouchListener touchListener = new TouchListener();
// TouchNotifier touchNotifier = new TouchNotifier();
// touchNotifier.register(touchListener);
LCD.drawChar('A', 0,3);
}
// public static void helloWorld() {
// System.out.println("Hello World");
// Button.waitForAnyPress();
// }
// public static void touchSensorTest() {
// TouchSensor touchSensor = new TouchSensor(SensorPort.S1);
// boolean isStopped = true;
//
// while (isStopped) {
// if (touchSensor.isPressed()) {
// Motor.A.setSpeed(2000);
// Motor.A.forward();
// } else {
// isStopped = false;
// while (!isStopped) {
// if (touchSensor.isPressed()) {
// Motor.A.stop();
// isStopped = true;
// }
// }
// }
// }
//
// }
//
// public static void moveTest() {
// Motor.A.setSpeed(1080);
// Motor.A.forward();
// try {
// Thread.sleep(2000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// Motor.A.backward();
// try {
// Thread.sleep(2000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// }
// public static void ultraSensorTest() throws InterruptedException {
// UltrasonicSensor us = new UltrasonicSensor(SensorPort.S1);
// while(true){
// int value = us.getDistance();
// LCD.clear();
// LCD.drawInt(value, 0, 3);
// LCD.refresh();
// Thread.sleep(500);
// }
// }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment