Class: GPIO::OutputPin
Instance Attribute Summary
Attributes inherited from Pin
#device, #file, #hardware_pin, #mode, #pin, #software_pin
Instance Method Summary collapse
-
#initialize(params) ⇒ OutputPin
constructor
(pin, mode, device=:RaspberryPi).
- #off ⇒ Object
- #on ⇒ Object
Methods inherited from Pin
Constructor Details
#initialize(params) ⇒ OutputPin
(pin, mode, device=:RaspberryPi)
3 4 5 6 |
# File 'lib/gpio/pins/output_pin.rb', line 3 def initialize(params) #(pin, mode, device=:RaspberryPi) params.merge!(:mode => :out) super(params) end |
Instance Method Details
#off ⇒ Object
12 13 14 15 |
# File 'lib/gpio/pins/output_pin.rb', line 12 def off device.write software_pin, 0 read end |
#on ⇒ Object
8 9 10 11 |
# File 'lib/gpio/pins/output_pin.rb', line 8 def on device.write software_pin, 1 read end |