• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomeArduinoShieldsUse potentiometer module on Arduino
Previous Next

Use potentiometer module on Arduino

Posted by: Alvin Jin , March 3, 2014

[vc_row][vc_column width=”1/1″][vc_tour][vc_tab title=”Introduction” tab_id=”1393830658-1-50″][vc_column_text]Potentiometer module using a rotary potentiometer, potentiometer knob that can be changed to adjust the potentiometer resistance.

sa[/vc_column_text][/vc_tab][vc_tab title=”Hardware List and Wiring Diagram” tab_id=”1393830658-2-18″][vc_column_text]Hardware list

[bigcommerce link=”/arduino-uno-compatible-usb-board-r3/” target=”_blank”]Arduino UNO[/bigcommerce] *1

Rotary potentiometer  *1

Male to Female Dupont Line *3

Wiring Diagram as shown:

as[/vc_column_text][/vc_tab][vc_tab title=”Test Code” tab_id=”1393835490891-2-6″][vc_column_text]

int sensorPin = A0;
int ledPin = 13;
int sensorValue = 0;

void setup() {
  pinMode(ledPin, OUTPUT);  
  Serial.begin(115200);
}

void loop() {
  sensorValue = analogRead(sensorPin); 
  Serial.println(sensorValue);  
  //Serial.write(sensorValue);
  digitalWrite(ledPin, HIGH);  
  delay(100);          
  digitalWrite(ledPin, LOW);   
  delay(100);                  
}

[/vc_column_text][/vc_tab][vc_tab title=”Test result” tab_id=”1393835562783-3-6″][vc_column_text]By adjust Rotary Potentiometer‘s knob, we can see Arduino A0’s value changed, as shown

c[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]

Tags: Shields

Share!
Tweet

Alvin Jin

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors