class Led
Public Instance Methods
check_led(temp, set, range)
click to toggle source
this method will define which color the LED should be
# File lib/led.rb, line 5 def check_led(temp, set, range) if(temp < (set - range)) @color = "0000FF".colorize(:blue) @fcolor = "0000FF" elsif(temp > (set + range)) @color = "FF0000".colorize(:red) @fcolor = "FF0000" else @color = "00FF00".colorize(:green) @fcolor = "00FF00" end end
get_color()
click to toggle source
this method is used to publish ONLY the hexadecimal value to the RGB-LED
# File lib/led.rb, line 24 def get_color return @fcolor end
get_fcolor()
click to toggle source
this method is used to write the output to the log.txt file
# File lib/led.rb, line 29 def get_fcolor "The LED is #{@fcolor}" end
get_led()
click to toggle source
this method is used for the output if you run the program
# File lib/led.rb, line 19 def get_led "The LED is #{@color}" end