lemueltra

major_06_05

May 6th, 2016
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. package br.follow_line;
  2. import lejos.nxt.*;
  3. public class major {
  4.     static LightSensor light = new LightSensor(SensorPort.S1, true);
  5.     static int preto, branco;
  6.     public static void main(String[] args) throws Exception{
  7.         // TODO Auto-generated method stub 
  8.         Motor.A.resetTachoCount(); //Reiniciar contador de ângulo de giro do motor
  9.         Motor.B.resetTachoCount();
  10.        
  11.         System.out.println("Calibrar Sensor Para Cor Branca");
  12.         Thread.sleep(5000); //Delay de 5 segundos
  13.         branco = light.getNormalizedLightValue(); //Ler dados do sensor de luz
  14.         System.out.println("Sensor Calibrado Para Cor Branca " + branco);
  15.        
  16.         System.out.println("Calibrar Sensor Para Cor Preta");
  17.         Thread.sleep(5000);
  18.         preto = light.getNormalizedLightValue();
  19.         System.out.println("Sensor Calibrado Para Cor Preta " + preto);
  20.        
  21.         ler_dados ler_dados = new ler_dados(); //Chamar classe ler_dados via thread
  22.         Thread threadler= new Thread(ler_dados);
  23.         threadler.setPriority(Thread.MAX_PRIORITY);
  24.         threadler.start();
  25.     }
  26. }
Add Comment
Please, Sign In to add comment