farmbot-serial 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d753b8fc68043b95909c16c91852b39fa7536ea9
4
- data.tar.gz: 05eb278c7655f6e631a52b428d3bba354b5885e0
3
+ metadata.gz: b6cb4643e76ded7ebfa9d5a162ac7054aa5b073a
4
+ data.tar.gz: 3ec3133a071facfc6b30c294d0028d4c2aac55a8
5
5
  SHA512:
6
- metadata.gz: 3226279c9a81b5bdf7e70747b02a9339b4bed2a9742e4a32130948adbaa70b31666b181fe96ebc77e11e6c2532780801b46ae91666bca5b4830a8d164a9743e3
7
- data.tar.gz: 1d517d85eb5b53fa3d67bc845999299f936d0e007a84511a3eb64ef9effe7d7bb39990812fd8c96c5862c37ba53a9e9b8d8c7795e073e7b5036e5676b58a5b77
6
+ metadata.gz: 6f4e9a3c086c1be7805b9f7a8bba936fb167c5dccb92b22ed6f065b9be4dd68e4680139a82f09c3eb8099af2ebb62d6643fc1ef8ad64d83134b562354e26f182
7
+ data.tar.gz: 541032dd5e2dd8462da5e1d0eba48e8ec7b555604d90b228fd64ec5a90f59fba7ed356ad04794e51b99ad3e96b27c1e0caf6431d9716a978b286e7dc888a4d04
@@ -18,11 +18,14 @@ module FB
18
18
  end
19
19
 
20
20
  def move_relative(x: 0, y: 0, z: 0, s: 100)
21
- x = [(bot.current_position.x + (x || 0)), 0].max
22
- y = [(bot.current_position.y + (y || 0)), 0].max
23
- z = [(bot.current_position.z + (z || 0)), 0].max
24
-
25
- write { FB::Gcode.new { "G00 X#{x} Y#{y} Z#{z}" } }
21
+ write FB::Gcode.new do
22
+ # TODO: At some point, I will need to figure out why this is double
23
+ # firing. In the meantime, the fix is to use `||=` instead of `=`
24
+ x1 ||= [(bot.current_position.x + (x || 0)), 0].max
25
+ y1 ||= [(bot.current_position.y + (y || 0)), 0].max
26
+ z1 ||= [(bot.current_position.z + (z || 0)), 0].max
27
+ "G00 X#{x1} Y#{y1} Z#{z1}"
28
+ end
26
29
  end
27
30
 
28
31
  def move_absolute(x: 0, y: 0, z: 0, s: 100)
@@ -65,8 +68,7 @@ module FB
65
68
  private
66
69
 
67
70
  def write(str = "\n")
68
- bot.write( block_given? ? yield : FB::Gcode.new{ str } )
71
+ bot.write( block_given? ? yield : str )
69
72
  end
70
73
  end
71
74
  end
72
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: farmbot-serial
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Evers