diff --git a/samples/MacroLoader/README.md b/samples/MacroLoader/README.md index ecd7c284..4ca53fae 100755 --- a/samples/MacroLoader/README.md +++ b/samples/MacroLoader/README.md @@ -32,7 +32,8 @@ http://forum.gosphero.com/showthread...5-Share-Macros //Set Robot macro.setRobot(mRobot); //Send Macro to Sphero - macro.playMacro(); + mRobot.executeMacro(macro); + } catch (IOException e) { throw new RuntimeException(e); } catch (Exception e) { @@ -46,9 +47,10 @@ http://forum.gosphero.com/showthread...5-Share-Macros When you want to stop a previous played command, its easy to send in an Abort and reset the Sphero's state you want it to continue in. The code is as follows: AbortMacroCommand.sendCommand(mRobot); // abort command - StabilizationCommand.sendCommand(mRobot, true); // turn on stabilization - RGBLEDOutputCommand.sendCommand(mRobot, 255, 255, 255); // make Sphero White - FrontLEDOutputCommand.sendCommand(mRobot, 0.0f); // Turn off tail light + mRobot.enableStabilization(true); // turn on stabilization + mRobot.setColor(255, 255, 255); // make Sphero White + mRobot.setBackLEDBrightness(0.0f); // Turn off tail light + mRobot.stop(); // Stop rolling ## Chunky Macros vs Normal Macros diff --git a/samples/MacroLoader/src/com/orbotix/sample/macroloader/MacroLoader.java b/samples/MacroLoader/src/com/orbotix/sample/macroloader/MacroLoader.java index 8e83cb64..9c657b8d 100755 --- a/samples/MacroLoader/src/com/orbotix/sample/macroloader/MacroLoader.java +++ b/samples/MacroLoader/src/com/orbotix/sample/macroloader/MacroLoader.java @@ -101,7 +101,7 @@ public void largeDanceClicked(View v) { //Set Robot macro.setRobot(mRobot); //Send Macro to Sphero - macro.playMacro(); + mRobot.executeMacro(macro); } catch (IOException e) { throw new RuntimeException(e); } catch (Exception e) { @@ -128,7 +128,7 @@ public void commandClicked(View v) { //Set Robot macro.setRobot(mRobot); //Send Macro to Sphero - macro.playMacro(); + mRobot.executeMacro(macro); } catch (IOException e) { throw new RuntimeException(e); } catch (Exception e) { @@ -155,7 +155,7 @@ public void strobeClicked(View v) { //Set Robot macro.setRobot(mRobot); //Send Macro to Sphero - macro.playMacro(); + mRobot.executeMacro(macro); } catch (IOException e) { throw new RuntimeException(e); } catch (Exception e) { @@ -181,7 +181,7 @@ public void smallDanceClicked(View v) { //Set Robot macro.setRobot(mRobot); //Send Macro to Sphero - macro.playMacro(); + mRobot.executeMacro(macro); } catch (IOException e) { throw new RuntimeException(e); } catch (Exception e) { @@ -203,10 +203,10 @@ public void stopClicked(View v) { */ private void returnSpheroToStableState() { AbortMacroCommand.sendCommand(mRobot); // abort command - StabilizationCommand.sendCommand(mRobot, true); // turn on stabilization - RGBLEDOutputCommand.sendCommand(mRobot, 255, 255, 255); // make Sphero White - BackLEDOutputCommand.sendCommand(mRobot, 0.0f); // Turn off tail light - RollCommand.sendStop(mRobot); // Stop rolling + mRobot.enableStabilization(true); // turn on stabilization + mRobot.setColor(255, 255, 255); // make Sphero White + mRobot.setBackLEDBrightness(0.0f); // Turn off tail light + mRobot.stop(); // Stop rolling } }