Class: Denko::AnalogIO::Output

Inherits:
Object
  • Object
show all
Includes:
Behaviors::Callbacks, Behaviors::OutputPin, Behaviors::Threaded
Defined in:
lib/denko/analog_io/output.rb

Instance Attribute Summary

Attributes included from Behaviors::Threaded

#interrupts_enabled, #thread

Attributes included from Behaviors::Callbacks

#callback_mutex

Attributes included from Behaviors::SinglePin

#mode, #pin

Attributes included from Behaviors::Component

#board

Instance Method Summary collapse

Methods included from Behaviors::Threaded

#enable_interrupts, included, #stop, #stop_thread, #threaded, #threaded_loop

Methods included from Behaviors::Callbacks

#add_callback, #callbacks, #initialize, #pre_callback_filter, #remove_callback, #update

Methods included from Behaviors::State

#initialize, #state

Methods included from Behaviors::Component

#initialize, #micro_delay

Instance Method Details

#initialize_pins(options = {}) ⇒ Object



10
11
12
13
# File 'lib/denko/analog_io/output.rb', line 10

def initialize_pins(options={})
  super(options)
  self.mode = :output_dac
end

#write(value) ⇒ Object



15
16
17
18
# File 'lib/denko/analog_io/output.rb', line 15

def write(value)
  @board.dac_write(@pin, value)
  self.state = value
end