Could you post the code?
For Great Old Time Radio, Check Out
www.brandoclassicotr.com
www.brandoclassicots.com
Categories: RoboCommunity Lounge General WowWee Discussion RS Media
hi
i need some help with a simple midlet program for rs media. i want to know if my coding is right.
i just need the rsmedia todo a few arm movements. thats all.
can someone please help me out immediately? i need to get it ready by tonight.
i had done it earlier, but the files had got deleted off my computer, and now the code i rewrote is not working.
:(
thanks
Could you post the code?
For Great Old Time Radio, Check Out
www.brandoclassicotr.com
www.brandoclassicots.com
import com.sun.robot.humanoid.Humanoid;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class Main extends MIDlet {
private final Humanoid humanoid;
public Main() {
humanoid = Humanoid.getInstance();
}
protected void startApp() throws MIDletStateChangeException{
// Begin by adjusting to a good default position.
humanoid.restoreDefaultPosition();
// Exercise Routine
exercise();
}
protected void pauseApp() {
//stop the Robot
humanoid.stop();
}
protected void destroyApp(boolean b) throws MIDletStateChangeException {
//shutdown the Robot
humanoid.shutdown();
}
private void exercise(){
humanoid.SHOULDER_LEFT_SERVO.moveToPosition(0, 8);
humanoid.SHOULDER_RIGHT_SERVO.moveToPosition(0, 8);
humanoid.waitUntilStop();
humanoid.SHOULDER_LEFT_SERVO.moveToPosition(22, 8);
humanoid.SHOULDER_RIGHT_SERVO.moveToPosition(22, 8);
humanoid.waitUntilStop();
humanoid.WAIST_UP_DN_SERVO.moveToPosition(14, 8);
humanoid.waitUntilStop();
humanoid.WAIST_UP_DN_SERVO.moveToPosition(28, 8);
humanoid.waitUntilStop();
humanoid.LEFT_ARM.wave();
humanoid.RIGHT_ARM.wave();
}
}