Beagle Board - beagleboard.org

Demo: Potentiometer

A specific voltage can be sent to the ADC1 channel using a potentiometer. Please keep in mind that each one of the ADC pins can only handle 1.8V maximum.

Example

var b = require('bonescript');
b.analogRead('P9_40', printAIN1);

function printAIN1(x) {
    console.log('x.value = ' + x.value);
    console.log('x.err = ' + x.err);
}                    




Build and execute instructions

  • Hook up a BeagleBone or BeagleBone Black to the breadboard as shown in the diagram on the right.
  • After clicking ‘run’, the ADC1 channel will output a reading between 0-1, where 0 is 0V and 1 is the maximum input voltage (1.8V).
  • Adjust your potentiometer's knob and click run again. The lower the resistance, the higher voltage you will see.
  • Alter the code to look at inputs on other analog input pins. A schematic showing all available ADC channels are listed here.

See also

Related functions

Where to buy

See it in action


Last updated by jkridner.wordpress.com on Fri Nov 14 2014 14:22:43 GMT-0000 (UTC).
21061