Class: FB::ArduinoCommandSet

Inherits:
Object
  • Object
show all
Defined in:
lib/arduino/command_set.rb

Overview

Composes all logic related to controlling a bot into a single object. Responsible for writing to the serial line.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bot) ⇒ ArduinoCommandSet

Returns a new instance of ArduinoCommandSet.



7
8
9
# File 'lib/arduino/command_set.rb', line 7

def initialize(bot)
  @bot = bot
end

Instance Attribute Details

#botObject (readonly)

Returns the value of attribute bot.



5
6
7
# File 'lib/arduino/command_set.rb', line 5

def bot
  @bot
end

Instance Method Details

#done(gcode) ⇒ Object



32
33
# File 'lib/arduino/command_set.rb', line 32

def done(gcode)
end

#emergency_stopObject



16
17
18
# File 'lib/arduino/command_set.rb', line 16

def emergency_stop(*)
  bot.write("E")
end

#execute(gcode) ⇒ Object



11
12
13
14
# File 'lib/arduino/command_set.rb', line 11

def execute(gcode)
  puts "SERIAL OUT: #{gcode.name}"
  self.send(gcode.name, gcode)
end

#move_relative(gcode) ⇒ Object



20
21
# File 'lib/arduino/command_set.rb', line 20

def move_relative(gcode)
end

#received(gcode) ⇒ Object



23
24
# File 'lib/arduino/command_set.rb', line 23

def received(gcode)
end

#report_current_position(gcode) ⇒ Object



29
30
# File 'lib/arduino/command_set.rb', line 29

def report_current_position(gcode)
end

#report_status_value(gcode) ⇒ Object



35
36
# File 'lib/arduino/command_set.rb', line 35

def report_status_value(gcode)
end

#reporting_end_stops(gcode) ⇒ Object



26
27
# File 'lib/arduino/command_set.rb', line 26

def reporting_end_stops(gcode)
end