Skip to content
Snippets Groups Projects
Commit 44a93fae authored by Viktor Rönnbäck's avatar Viktor Rönnbäck
Browse files

Final code for app

parent 66f0673b
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,8 @@ import java.util.Timer; ...@@ -9,7 +9,8 @@ import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
public class CommandButton { public class CommandButton {
public static int RESEND_TIME = 100; // Time in ms for commands to be re-sent to Arduino final private static int RESEND_TIME = 100; // Time in ms for commands to be re-sent to Arduino
final private static int TIME_BEFORE_STOP = 100;
private Button btn; private Button btn;
private String cmd; private String cmd;
...@@ -92,6 +93,15 @@ public class CommandButton { ...@@ -92,6 +93,15 @@ public class CommandButton {
sendArduinoCmdTask = new SendArduinoCmd(); sendArduinoCmdTask = new SendArduinoCmd();
timer = new Timer(); timer = new Timer();
// Send stop command when button is no longer pressed
String cmdText = "s";
// Debug
System.out.println("Sending command: " + cmdText);
// Send command to Arduino board
connectedThread.write(cmdText);
} }
return true; return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment