Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Bluetooth-Controller
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Viktor Rönnbäck
Bluetooth-Controller
Commits
44a93fae
Commit
44a93fae
authored
3 years ago
by
Viktor Rönnbäck
Browse files
Options
Downloads
Patches
Plain Diff
Final code for app
parent
66f0673b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/se/liu/vikro145/bluetoothcontrol/CommandButton.java
+11
-1
11 additions, 1 deletion
.../java/se/liu/vikro145/bluetoothcontrol/CommandButton.java
with
11 additions
and
1 deletion
app/src/main/java/se/liu/vikro145/bluetoothcontrol/CommandButton.java
+
11
−
1
View file @
44a93fae
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment