1

I just got a Sphero v2.0 and have been playing with the SDK to create android apps in Eclipse for the Sphero.

In the official app there is a function to make the Sphero jump for the ground https://play.google.com/store/apps/details?id=orbotix.sphero&hl=en

I can control the movement of Sphero but can't find a way to make it Jump via code. Does any one know how to do this?

user2114573
  • 57
  • 2
  • 5

1 Answers1

0

I have been able to do this on iOS with this macro:

RKMacroObject *macro = [RKMacroObject new];
[macro addCommand:[RKMCRoll commandWithSpeed:0.15 heading:0 delay:0]];
[macro addCommand:[RKMCRawMotor commandWithLeftMode:1 leftSpeed:255 rightMode:1 rightSpeed:253 delay:255]];
[macro addCommand:[RKMCDelay commandWithDelay:1000]];
[macro playMacro];

I guess it would look something like this in Java :)

MacroObject macro = new MacroObject();
macro.addCommand(new Roll(0.15, 0, 0));
macro.addCommand(new RawMotor(1, 255, 1, 253, 255);
macro.addCommand(new Delay(1000));
sphero.executeMacro(macro);

Then, you can tweak the roll speed, delay and differences between speed of left and right motor.

libec
  • 1,555
  • 1
  • 10
  • 19