Fix issue with pin_write() flipping mode <--> value
parent
c161563b85
commit
ad56526187
2
Gemfile
2
Gemfile
|
@ -9,7 +9,7 @@ gem 'sqlite3'
|
|||
# Use bson for database functionality
|
||||
gem 'bson'
|
||||
|
||||
gem 'farmbot-serial', '0.2.3'
|
||||
gem 'farmbot-serial', '0.2.4'
|
||||
gem 'meshruby', '0.0.3'
|
||||
gem 'polyglot'
|
||||
gem 'httparty'
|
||||
|
|
5
idea.rb
5
idea.rb
|
@ -18,16 +18,13 @@ class FarmBotPi
|
|||
end
|
||||
|
||||
def start
|
||||
mesh.toggle_debug!
|
||||
|
||||
EM.run do
|
||||
mesh.connect
|
||||
mesh.onmessage { |msg| handler.call(msg, bot, mesh) }
|
||||
|
||||
FB::ArduinoEventMachine.connect(bot)
|
||||
|
||||
0.upto(14) { |num| bot.commands.read_parameter(num) }
|
||||
bot.onmessage { |msg| bot.log "BOT MSG: #{msg}"}
|
||||
bot.onmessage { |msg| bot.log "BOT MSG: #{msg}" unless msg.name == :idle}
|
||||
bot.onclose { puts 'Disconnected'; EM.stop }
|
||||
bot.onchange { |diff| bot.log "BOT DIF: #{diff}" }
|
||||
end
|
||||
|
|
|
@ -18,6 +18,7 @@ class SingleCommandController < AbstractController
|
|||
action = AVAILABLE_ACTIONS[cmd["action"].to_s.downcase] || :unknown
|
||||
puts "Calling #{action}"
|
||||
send(action)
|
||||
reply "read_status", confirmation: true, command: cmd
|
||||
end
|
||||
|
||||
def move_relative
|
||||
|
@ -46,8 +47,8 @@ class SingleCommandController < AbstractController
|
|||
|
||||
def pin_write
|
||||
bot.commands.pin_write pin: cmd['pin'],
|
||||
value: cmd['mode'],
|
||||
mode: cmd['value1']
|
||||
value: cmd['value1'],
|
||||
mode: cmd['mode'] || 0
|
||||
end
|
||||
|
||||
def emergency_stop
|
||||
|
|
Loading…
Reference in New Issue