techmodek:
@Robin2lets say before i power down the arduino, is there a way i can save the positions of the servos to memory so when i power up, the servos doesnt jump back to center or should i make sure the servos are at 90 before i power down
I take it then there were no "faults" with my code ![]()
I did suggest a shutdown procedure in Reply #15.
If you can organize things so that the servos don't move on startup - i.e. don't move until they receive a command to move - then you could (in theory) save the positions in non-volatile memory after every change and then it wouldn't matter when the plug is pulled you could always recover the positions from the previous move. BUT ... it's not practical to do this with the on-chip eeprom because it has a limited lifetime. Adding an SD Card might be an option - at least if you wear that out you could easily replace it.
Overall I think I would follow a different and simpler strategy - it is a model, after all. I would have a formal shut down procedure that returns everything to a safe position from which it will be started. And I would also have a special initialization routine that moves each servo in turn to its start position slowly. This would allow for unexpected shut downs.
...R