KS0373 EASY plug Slide Potentiometer: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
[[image:ks0373图.jpg|thumb|500px|right|EASY plug Slide Potentiometer ]]
[[image:ks0373图.jpg|thumb|500px|right|EASY plug Slide Potentiometer ]]


Line 23: Line 24:
==Connect It Up==
==Connect It Up==
Connect the EASY Plug Slide Potentiometer to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable.
Connect the EASY Plug Slide Potentiometer to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable.
<br>[[File:KS0373.jpg|500px|frameless|thumb]]<br>
<br>
==Upload the Code==
<br>[[File:ks0398 11.1.png|500px|frameless|thumb]]<br>
<br>
==What You Should See==
<br>[[File:ks0398 11-1.png|500px|frameless|thumb]]<br>
After uploading the code, open the serial monitor and set the baud rate to 9600, you should be able to see the analog value of analog pin A0.
If slide the slider, the value will change.
<br>[[File:ks0398 11-2.png|500px|frameless|thumb]]<br>
<br>
==Controlling LED Brightness==
Except from reading the analog value of slide potentiometer, you are able to use the slide potentiometer to control the brightness of LED.
<br>
'''Hookup Guide'''<br>
<br>[[File:滑竿灯.jpg|500px|frameless|thumb]]<br>


<br>[[File:KS0373.jpg|500px|frameless|thumb]]<br>
<br>
'''Test Code'''<br>
<br>[[File:ks0398 10.2.png|500px|frameless|thumb]]<br>


<br>
'''What You Should See'''<br>
After uploading the code, slide the potentiometer, the brightness of LED will change.
<br>[[File:ks0398 10-3.png|500px|frameless|thumb]]<br>
<br>
<br>


==Upload the Code==
==Controlling Servo Angle==
Copy and paste below code to Arduino IDE and upload.
 
<pre>
'''Hookup Guide'''<br>
void setup() {
<br>[[File:滑竿舵机.jpg|500px|frameless|thumb]]<br>
  // initialize serial communication at 9600 bits per second:
 
  Serial.begin(9600);
<br>  
}
'''Test Code'''<br>
<br>[[File:ks0398 11.3.png|800px|frameless|thumb]]<br>


// the loop routine runs over and over again forever:
<br>
void loop() {
'''What You Should See'''<br>
  // read the input on analog pin 0:
After uploading the code, slide the potentiometer, the servo motor will rotate to a certain angle.
  int sensorValue = analogRead(A0);
<br>[[File:ks0398 11-4.png|500px|frameless|thumb]]<br>
  // print out the value you read:
  Serial.println(sensorValue);
  delay(1); // delay in between reads for stability
}
</pre>


<br>
<br>
==What You Should See==
After uploading the code, open the serial monitor and set the baud rate to 9600, you should be able to see the analog value of analog pin A0. If slide the slider, the value will change within the range of 0-1023.
<br>[[File:ks0373 Result.png|500px|frameless|thumb]]<br>


<br>
<br>
==Resources ==
==Resources ==
'''Download the PDF:'''<br>
'''Download the PDF:'''<br>

Revision as of 15:04, 10 May 2019

EASY plug Slide Potentiometer

Introduction

The EASY plug slide potentiometer uses high-quality sliding appliances for stable and reliable performance. It is a dual analog output that outputs a 0-VCC analog voltage signal.
The module pins are extended into Registered jack, so you can easily connect it to EASY Plug control board using a RJ11 cable.
There are 6 pad interfaces on the module. So you can solder two 3pin headers with a pitch of 2.54mm on the module.
It can be used to connect with other MCUs. The signal terminal outputs two analog values. The sum of the two analog values is 1023.
Note: this module should be used together with EASY plug control board.


Parameters

  • Operating Voltage: DC 3.3V-5V
  • Resistance: 10K
  • Port: analog quantity
  • Property: ROHS


Technical Details

  • Dimensions: 28mm*76.7mm*31.3mm
  • Weight: 17g


Connect It Up

Connect the EASY Plug Slide Potentiometer to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable.
thumb


Upload the Code


thumb


What You Should See


thumb
After uploading the code, open the serial monitor and set the baud rate to 9600, you should be able to see the analog value of analog pin A0. If slide the slider, the value will change.
thumb


Controlling LED Brightness

Except from reading the analog value of slide potentiometer, you are able to use the slide potentiometer to control the brightness of LED.
Hookup Guide

thumb


Test Code

thumb


What You Should See
After uploading the code, slide the potentiometer, the brightness of LED will change.
thumb

Controlling Servo Angle

Hookup Guide

thumb


Test Code

thumb


What You Should See
After uploading the code, slide the potentiometer, the servo motor will rotate to a certain angle.
thumb



Resources

Download the PDF:
https://drive.google.com/open?id=1n8INX4yU_KDlEKbMbqmcpmYVBgFvHKoQ

Download the Code:
https://drive.google.com/open?id=1sGmlgFSFWkAGKCc80QdEbuzSE36RwF2m


Buy from