File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ def start
13
13
while true
14
14
byte = query . output_byte_for_arduino
15
15
io . write byte
16
+ puts query . debug_stats
16
17
puts "Wrote: #{ byte . ord } "
17
18
sleep 60
18
19
end
@@ -24,7 +25,7 @@ def demo(io)
24
25
# IO#write calls #to_s on its input
25
26
io . write i . chr
26
27
puts "read: " + io . read_nonblock ( 1024 ) . inspect rescue Errno ::EAGAIN
27
- sleep 0.5
28
+ sleep 0.1
28
29
end
29
30
end
30
31
Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ def initialize activity
14
14
@activity = activity
15
15
end
16
16
17
+ def debug_stats
18
+ "#{ current_steps } of #{ step_goal } steps, #{ ( percentage_of_step_goal_for_time_of_day * 100 ) . round } % for time of day"
19
+ end
20
+
17
21
def output_byte_for_arduino
18
22
percentage = percentage_of_step_goal_for_time_of_day
19
23
if current_steps >= step_goal
You can’t perform that action at this time.
0 commit comments