LinkNode Rotary Potentiometer Module

From LinkSprite Playgound
Revision as of 02:22, 13 December 2016 by Alvin (talk | contribs) (Created page with "== Introduction == The Rotary Potentiometer Module produces analog output between 0 and Vcc (3.3V DC with LinkNode D1 ) on it’s “OUT” connector. The angular range is 30...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction

The Rotary Potentiometer Module produces analog output between 0 and Vcc (3.3V DC with LinkNode D1 ) on it’s “OUT” connector. The angular range is 300 degrees with a linear change in value. The resistance value is 10kΩ.

Rotary D1.jpg

Rotary D1 2.jpg

Wiring & Running

The module is connected to the base shield J9:

Sensor Signal --> LinkNode D1 ADC0

This example uses ADC channel 0 to get the value of the rotary potentiometer output voltage.

Open the Arduino IDE serial monitor ( BAUD 9600 ) , you can see the module output voltage.

Rotary D1 3.png

Rotary D1 4.png

Simple Code

void setup() {
  // put your setup code here, to run once:
   Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
   int value = analogRead(A0);
   float voltage = (value) * (3.3/1024.0);
   Serial.print("Output Voltage (Unit:V) : ");
   Serial.println(voltage,2);
   delay(300);
}