Class: RubimCode::UserOutput
Overview
Instance Attribute Summary
Attributes inherited from UserIO
#name, #pin, #port, #type
Instance Method Summary
collapse
Constructor Details
#initialize(name, port: nil, pin: nil, type: "normal") ⇒ UserOutput
Returns a new instance of UserOutput.
60
61
62
63
|
# File 'lib/rubimc/io_ports.rb', line 60
def initialize(name, port: nil, pin: nil, type: "normal")
super
RubimCode.pout(RubimCode.rubim_sbit("DDR#{port}", "#{pin}") + " /* #{self.name} configure as output */ ")
end
|
Instance Method Details
70
71
72
|
# File 'lib/rubimc/io_ports.rb', line 70
def off
RubimCode.pout(RubimCode.rubim_cbit("PORT#{port}", "#{pin}") + " /*#{self.name}.#{__method__}*/")
end
|
66
67
68
|
# File 'lib/rubimc/io_ports.rb', line 66
def on
RubimCode.pout(RubimCode.rubim_sbit("PORT#{port}", "#{pin}") + " /*#{self.name}.#{__method__}*/")
end
|
74
75
76
|
# File 'lib/rubimc/io_ports.rb', line 74
def toggle
RubimCode.pout(RubimCode.rubim_tbit("PORT#{port}", "#{pin}") + " /*#{self.name}.#{__method__}*/")
end
|