class Roxanne::GPIO::Publisher
Attributes
green_pin[RW]
orange_pin[RW]
red_pin[RW]
Public Instance Methods
disable()
click to toggle source
# File lib/roxanne/gpio/publisher.rb, line 8 def disable [green_pin, orange_pin, red_pin].each do |num| Taopaipai.gpio.pin(num, direction: :out).value 0 end end
push(previous, status)
click to toggle source
# File lib/roxanne/gpio/publisher.rb, line 14 def push(previous, status) return disable unless status [:green, :orange, :red].each do |color| Taopaipai.gpio.pin(send("#{color}_pin"), direction: :out). value(color == status ? 1 : 0) end end