|
import josx.platform.rcx.*; public class Example { public static void main (String[] args) throws Exception { Sensor.S1.setTypeAndMode (1, 0x20); Sensor.S1.activate(); Motor.A.forward(); Motor.C.forward(); WaitFor.push(Sensor.S1); Motor.A.stop(); Motor.C.stop(); } } |
| Note: After each sound is played you have to insert a Thread.sleep(time) or some type of action that requires time. leJOS dosn't pause for the sound to be played. |