Class: RubimCode::UserInput
Overview
end UserInput class
Instance Attribute Summary
Attributes inherited from UserIO
Instance Method Summary collapse
- #hi? ⇒ Boolean
-
#initialize(name, port: nil, pin: nil, type: "normal") ⇒ UserInput
constructor
A new instance of UserInput.
- #low? ⇒ Boolean
Constructor Details
#initialize(name, port: nil, pin: nil, type: "normal") ⇒ UserInput
Returns a new instance of UserInput.
80 81 82 83 |
# File 'lib/rubimc/io_ports.rb', line 80 def initialize(name, port: nil, pin: nil, type: "normal") super RubimCode.pout(RubimCode.rubim_cbit("DDR#{port}", "#{pin}") + " /* #{self.name} configure as output */ ") end |
Instance Method Details
#hi? ⇒ Boolean
86 87 88 |
# File 'lib/rubimc/io_ports.rb', line 86 def hi? "bit_is_set(PORT#{port}, #{pin})" + " /*#{self.name}.#{__method__}*/" end |
#low? ⇒ Boolean
90 91 92 |
# File 'lib/rubimc/io_ports.rb', line 90 def low? "bit_is_clear(PORT#{port}, #{pin})" + " /*#{self.name}.#{__method__}*/" end |