Hello!
I am working on a project that has some power constraints and I am looking to have the program resume where it cut off if the power runs low. When the program (and the robot) execute the provided course, I will be recording the state that the controller is in, via an integer value. When we do run out of power, I would like to be able to have the previous state of the controller saved to non-volatile memory. I have tried to use the progmem declaration as such:
#include <pololu/orangutan.h>
#include <avr/pgmspace.h>
int state PROGMEM;
int main()
{
if(button_is_pressed(ALL_BUTTONS))
state = 0; // initialize state
state+=1;
...
but I am getting the following compiler error:
Does anyone have a suggestion on how I can accomplish this? I only want to store about four integer values on the controller (SV-328P). Thanks and have a great day!