Knob

Knob Knob Knob

The knob is a device called a 'potentiometer'. It is a resistor whose resistance changes as you turn the knob. Resistance limits the electrical current that can flow through the circuit. The Arduino can measure the resistance, and then tell you what setting the knob is at.

Main Function

awesome.knob.reading()

Gets a position reading from the knob.

Returns

It returns an int, which is the knob position between 0-1023. 0 means the knob is turned as far counter-clockwise as possible. 1023 means it is turned as far clockwise as possible.

Example

// Turns the LED on if light level is greater than 500 if ( awesome.knob.reading() > 500 ) { awesome.LED.turnOn(); }

Advanced Function

awesome.knob.print()

First it takes a reading from the knob. Then it sends a message including this reading over the Serial connection.

Click the magnifying glass icon in the top right hand corner of the Arduino IDE to see the messages that Arduino sends to your computer through the Serial connection.

Example

// print a knob reading over the Serial connection awesome.knob.print();

Tips

This is a handy component to use when you want to manually change a value (think variable) in your sketch. For example, you could use it to adjust the brightness of the LED or the pitch of the buzzer.

x

Hi awesome backer,

Thanks again for supporting us on Kickstarter or Indiegogo.

On this website you can access the learning videos and documentation. You'll need to sign up for an account but it shouldn't take long and allows us to remember your video progress so you don't have to keep track of that.

We hope you have a great time learning with Awesome Shield.


Close Message