farmbot-serial 0.7.4 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/arduino.rb +2 -1
- data/lib/arduino/incoming_handler.rb +1 -1
- data/lib/arduino/outgoing_handler.rb +2 -2
- data/lib/arduino/status.rb +3 -0
- data/lib/default_serial_port.rb +4 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36f578bd91bd95febe44ce8f75b1590d668cbf99
|
4
|
+
data.tar.gz: e5cdea88aa5cab14e18e939af4628df061b4ec24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c0365da760d44e89efedfb3e2ea6355895fc9158a6b894671a289283dbd3dec851c45aafffce5ee092f8a2de080ef687aa655c464a7b8b382d4edcf98214ecb
|
7
|
+
data.tar.gz: d88848b219d0dac50f3693fc2944b88d04ffa6a3ce04405fd4d2d1ee0f5b0dd97a8a495b94c050559d7f7da110307d668f48e7edf7d9392fd3c8bea9421d1698
|
data/README.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# STOP! You might not need this.
|
2
|
+
|
3
|
+
`farmbot-serial` is a component used by the [Farmbot Raspberry Pi](https://github.com/FarmBot/farmbot-raspberry-pi-controller). If you are just trying to install a FarmBot, you do not need to use this. This component will be auto installed when you install the [Raspberry Pi Controller](https://github.com/FarmBot/farmbot-raspberry-pi-controller).
|
4
|
+
|
5
|
+
If you are a developer looking to work directly with the FarmBot serial interface, you're in the right place.
|
6
|
+
|
1
7
|
# Farmbot-Serial
|
2
8
|
|
3
9
|
A ruby gem for controlling Farmbot via serial line with EventMachine.
|
data/lib/arduino.rb
CHANGED
@@ -4,8 +4,9 @@ require_relative 'arduino/incoming_handler'
|
|
4
4
|
require_relative 'arduino/outgoing_handler'
|
5
5
|
require_relative 'arduino/event_machine'
|
6
6
|
require_relative 'arduino/status'
|
7
|
-
# Communicate with the arduino using a serial interface
|
8
7
|
module FB
|
8
|
+
# Software abstraction layer for the Arduino's serial interface. Translates
|
9
|
+
# Ruby method calls into serial commands.
|
9
10
|
class Arduino
|
10
11
|
Position = Struct.new(:x, :y, :z)
|
11
12
|
|
data/lib/arduino/status.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
require 'ostruct'
|
2
2
|
module FB
|
3
|
+
# A status register that caches the state of the Arduino into a struct. Also
|
4
|
+
# broadcasts changes that can be hooked into via the onchange() event.
|
5
|
+
# bot.status[:X] # => Returns bot X coordinate.
|
3
6
|
class Status
|
4
7
|
# Map of informational status and default values for status within Arduino.
|
5
8
|
DEFAULT_INFO = {X: 0, Y: 0, Z: 0, S: 10, BUSY: 1, LAST: 'none', PINS: {}}
|
data/lib/default_serial_port.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
require 'serialport'
|
2
2
|
|
3
|
-
# This object creates a Serial IO with sane defaults, since most FarmBot
|
4
|
-
# follow the same serial configuration setup. You can build your own
|
5
|
-
# object also, if that's what you need.
|
3
|
+
# This object creates a Serial IO Object with sane defaults, since most FarmBot
|
4
|
+
# setups follow the same serial configuration setup. You can build your own
|
5
|
+
# SerialPort object also, if that's what you need. DefaultSerialPort is just a
|
6
|
+
# suggestion, rather than the only option. Any serial connection will work.
|
6
7
|
module FB
|
7
8
|
class DefaultSerialPort < SerialPort
|
8
9
|
COM_PORT = '/dev/ttyACM0'
|
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.7.
|
4
|
+
version: 0.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Evers
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-09-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -169,7 +169,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
169
169
|
requirements:
|
170
170
|
- - ">="
|
171
171
|
- !ruby/object:Gem::Version
|
172
|
-
version:
|
172
|
+
version: 1.9.3
|
173
173
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
174
174
|
requirements:
|
175
175
|
- - ">="
|