Class: Bertha
- Inherits:
-
Object
- Object
- Bertha
- Defined in:
- lib/bertha.rb
Class Method Summary collapse
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(port, speed = 9600) ⇒ Bertha
constructor
A new instance of Bertha.
- #version ⇒ Object
Constructor Details
#initialize(port, speed = 9600) ⇒ Bertha
Returns a new instance of Bertha.
5 6 7 8 9 |
# File 'lib/bertha.rb', line 5 def initialize port, speed = 9600 @serial = SerialPort.new port, speed, 8, 1 @serial.read_timeout = 200 @serial.read end |
Class Method Details
Instance Method Details
#close ⇒ Object
11 12 13 |
# File 'lib/bertha.rb', line 11 def close @serial.close end |
#version ⇒ Object
21 22 23 24 |
# File 'lib/bertha.rb', line 21 def version @serial.puts 'version' @serial.gets.chomp end |