Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package br.follow_line;
- import lejos.nxt.*;
- public class major {
- static LightSensor light = new LightSensor(SensorPort.S1, true);
- static int preto, branco;
- public static void main(String[] args) throws Exception{
- Motor.A.resetTachoCount(); //Reiniciar contador de ângulo de giro do motor
- Motor.B.resetTachoCount();
- System.out.print("Branco");
- Thread.sleep(5000); //Delay de 5 segundos
- branco = light.getNormalizedLightValue(); //Ler dados do sensor de luz
- System.out.println(branco);
- System.out.print("Preto");
- Thread.sleep(5000);
- preto = light.getNormalizedLightValue();
- System.out.println(preto);
- ler_dados ler_dados = new ler_dados(); //Chamar classe ler_dados via thread
- Thread threadler= new Thread(ler_dados);
- threadler.setPriority(Thread.MAX_PRIORITY);
- threadler.start();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment