Maybe a silly question, but is it possible to perform a software reset on the Industruino ?
I did find the following routine which seems to reset the harware but when my program starts it behaves in a different manner.
asm volatile (" jmp 0");
Something is not quiet right but I'm not sure what..
here is how I do it in my projects.
I use Watchdog timer reset.
So first include the watchdog library:
Then setup the Watchdog in setup():
//Enable WDT timer
wdt_enable(8); //This is equal to WTDO_4S, which is available on AT90USB1286 but probably not reported in wdt.h file
Then I put this line at the beginning of ReadButtons():
buttonEnterState = !digitalRead(buttonEnterPin);
buttonUpState = !digitalRead(buttonUpPin);
buttonDownState = !digitalRead(buttonDownPin);
//Reset WDT if Enter not pressed
//After 8 seconds machine will reset (actually 4)
//Also in case it hangs for other reasons
if(buttonEnterState == LOW) wdt_reset();
So if you press the Enter key for more than 4 seconds, the machine will reset.
Hope this is useful!
The most reliable way to do this is through the hardware watchdog timer. Another way is defining the function
void (*resetFunc)(void) = 0;
but that does not do a full restart (documented elsewher).
You can read more about watchdog timers at https://industruino.com/page/wdt (sorry for formatting issues)
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!