class BBB::Components::Nunchuck::Controls
Public Class Methods
new()
click to toggle source
# File lib/BBB/components/nunchuck.rb, line 90 def initialize initialize_buttons initialize_axis end
Public Instance Methods
c()
click to toggle source
# File lib/BBB/components/nunchuck.rb, line 101 def c @buttons[:c] end
initialize_axis()
click to toggle source
# File lib/BBB/components/nunchuck.rb, line 109 def initialize_axis @axis = Hash.new @axis[:x] = ControlAxis.new @axis[:y] = ControlAxis.new end
update(bytes)
click to toggle source
# File lib/BBB/components/nunchuck.rb, line 115 def update(bytes) update_buttons(bytes) update_axis(bytes) end
update_axis(bytes)
click to toggle source
# File lib/BBB/components/nunchuck.rb, line 128 def update_axis(bytes) @axis[:x].update(bytes[0]) @axis[:y].update(bytes[1]) end
z()
click to toggle source
# File lib/BBB/components/nunchuck.rb, line 105 def z @buttons[:z] end