java - RoboJDE PingSensor Following Hand -
here code, cannot follow hand example.
import com.ridgesoft.intellibrain.intellibrain; import com.ridgesoft.io.display; import com.ridgesoft.intellibrain.intellibraindigitalio; public class pingsensor { public static void main(string args[]) { try { display display = intellibrain.getlcddisplay(); display.print(0, "ping test"); intellibraindigitalio pingport = intellibrain.getdigitalio(3); pingport.enablepulsemeasurement(true); while (true) { pingport.pulse(20); thread.sleep(50); display.print(1, "time: " + pingport.readpulseduration()); thread.sleep(450); } } catch(throwable t) { t.printstacktrace(); } } }
the code compiles, when try run it, not move. need make code this.
i need 2 parameters, measure max distance , min distance, if @ max distance should move forward, while @ min distance, should move backwards
Comments
Post a Comment