I am making an arcade station with a Latte Panda v1.0 as the main computer which plays fun games like “The Game of Life” an others.
In the middle there is a “World Reset” button and pressing it is supposed to reset the game and load back to the desktop.
I found a way to do this was to have the button trigger a relay with a 5 second delay. As if you were simply unplugging the computer, waiting 5 seconds, and plugging it back in.
However, this leads to more problems as even though “Auto Power On” is enabled in the BIOS the computer starts back up without error maybe 50% of the time. Usually saying something like Windows did not shutdown correctly, etc. See image 1.
So, this brings me to the latest solution and question!!!
I found that by opening the cmd command line running the line “shutdown /r /f /t 0” would more properly restart the computer in a timely fashion without error.
But, I am stuck with how to run that through Processing so it can be automated with a button press. As in use an Arduino to sense the “World Reset” button, send a command through USB to Processing, use the “exec()” function to then type the command line and run it.
I feel like I am close and this is what I have so far. I am getting the error “Exception while attempting shutdown /r /f /t 0”. See Image 2.
Any ideas how I could make this work?
I am open to totally other ideas I just know the only constraints are using the “World Reset” button right in front of the screen to restart the computer.
import java.io.*;
void setup() {
size(100, 100);
}
void draw() {
background(20);
fill(200);
ellipse(mouseX, mouseY, 25, 25);
}
void mousePressed() {
// run command to restart computer...
exec("shutdown /r /f /t 0");
//exit();
//exec()
}