class BBB::Components::AnalogComponent

An AnalogComponent is a component that reads from an analog input (AIN) on the board. You can use a generic analog component for, for example, temperature or light sensors.

The BeagleBoneBlack has 12 bit (4096) AIN pins. So the expected value of an analog pin is between 0 and 4096.

Public Instance Methods

read() click to toggle source

Read from an initialized pin, if the pins have not been initialized yet, this method might actually raise an exception.

@raise MethodNotFoundException

@return Integer

# File lib/BBB/components/analog_component.rb, line 24
def read
  pin.read
end
value() click to toggle source

@see read

# File lib/BBB/components/analog_component.rb, line 31
def value
  read
end