I am looking to get into loading OrbBasic programs into the persistent memory on sphero to allow them to run when the sphero is woken up. I have had luck loading programs into ram using the OrbBasicSample provided in the SDK, so I decided to try modifying the sample app to load the program into the flash memory instead. To accomplish this I changed from using the OrbBasicProgram object and it's methods, to the OrbBasicAppendFragmentCommand, OrbBasicExecuteProgramCommand, and OrbBasicEraseStorageCommand methods.
This resulted in the button pressed methods looking like this:
public void loadPressed(View v) {
addMessageToStatus("Loading OrbBasic Program...");
OrbBasicAppendFragmentCommand.sendCommand(mRobot, false, program);
}
public void abortPressed(View v) {
addMessageToStatus("Aborting OrbBasic Program");
OrbBasicAbortProgramCommand.sendCommand(mRobot);
}
public void executePressed(View v) {
addMessageToStatus("Executing OrbBasic Program");
OrbBasicExecuteProgramCommand.sendCommand(mRobot, false, 10);
}
public void erasePressed(View v) {
addMessageToStatus("Erasing OrbBasic Program...");
OrbBasicEraseStorageCommand.sendCommand(mRobot, false);
}
With the boolean value set to false, the program is loaded into RAM and runs as expected, when I change the value to true, it stops working altogether. Is there something I am missing to get the functionality I am looking for?