Class: FakeArduinoReader
Instance Method Summary
collapse
#initialize
Constructor Details
This class inherits a constructor from ArduinoReader
Instance Method Details
#connect ⇒ Object
35
36
37
38
|
# File 'lib/arduino_reader.rb', line 35
def connect
@inputs << AnalogInput.new(window: @window, pin: 0)
@inputs << AnalogInput.new(window: @window, pin: 1)
end
|
#pwm ⇒ Object
40
41
42
|
# File 'lib/arduino_reader.rb', line 40
def pwm
return true
end
|
#setup_callbacks ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/arduino_reader.rb', line 44
def setup_callbacks
Thread.new {
loop do
AnalogInput[0].callback(0)
AnalogInput[1].callback(rand(1023))
sleep 0.09
AnalogInput[0].callback(1023)
sleep 0.09
end
}
end
|