Class: Denko::DigitalIO::Output
Constant Summary
Behaviors::Lifecycle::CALLBACK_METHODS
Behaviors::OutputPin::OUTPUT_MODES
Instance Attribute Summary
#interrupts_enabled, #thread
#state
#mode, #pin
#board, #params
Instance Method Summary
collapse
included
#enable_interrupts, included, #mruby_thread_check, #stop, #stop_thread, #threaded, #threaded_loop
#add_callback, #callbacks, #remove_callback, #update
#update_state
#convert_pins, #initialize_pins
#initialize, #micro_delay
Instance Method Details
#digital_write(value) ⇒ Object
Also known as:
write
21
22
23
24
|
# File 'lib/denko/digital_io/output.rb', line 21
def digital_write(value)
@board.digital_write(@pin, value)
@state = value
end
|
#high ⇒ Object
Also known as:
on
38
39
40
|
# File 'lib/denko/digital_io/output.rb', line 38
def high
digital_write(board.high)
end
|
#high? ⇒ Boolean
Also known as:
on?
49
|
# File 'lib/denko/digital_io/output.rb', line 49
def high?; state == board.high end
|
#low ⇒ Object
Also known as:
off
34
35
36
|
# File 'lib/denko/digital_io/output.rb', line 34
def low
digital_write(board.low)
end
|
#low? ⇒ Boolean
Also known as:
off?
50
|
# File 'lib/denko/digital_io/output.rb', line 50
def low?; state == board.low end
|
#pre_callback_filter(board_state) ⇒ Object
15
16
17
|
# File 'lib/denko/digital_io/output.rb', line 15
def pre_callback_filter(board_state)
board_state.to_i
end
|
#toggle ⇒ Object
42
43
44
|
# File 'lib/denko/digital_io/output.rb', line 42
def toggle
state == board.low ? high : low
end
|