Research
Go
Search
Contact
About Jab
Education
Research
Home
Contents
Go Back
RADAR BOT 1.1
RADAR_BOT.java
import lejos.nxt.*; import javax.microedition.lcdui.Graphics; public class RADAR_BOT { static int batteryLife; public static void credits(){ LCD.clear(); LCD.drawString("Juan Antonio",0,1); LCD.drawString("Brenha. Moral",0,2); LCD.drawString("juanantonio.info",0,3); LCD.refresh(); } public static void main(String [] options) throws Exception { batteryLife = Battery.getVoltageMilliVolt(); //Motor settings Motor.A.setSpeed(900); //Instances CompassSensor compassObj = new CompassSensor(SensorPort.S2); UltrasonicSensor usObj = new UltrasonicSensor(SensorPort.S1); Graphics gObj = new Graphics(); RADAR1_6 radarObj = new RADAR1_6(compassObj,usObj,Motor.A,gObj); //Store historical information about the enviroment where, Radar Bot operate radarObj.knowEnviroment(); Sound.playTone(50, 200); radarObj.moveToDegreeCero(); radarObj.showEnviroment(); while(!Button.ESCAPE.isPressed()){ Motor.A.forward(); radarObj.detect(); } Motor.A.stop(); Thread.sleep(5000); credits(); } }
Top