Ks0014 keyestudio Analog Rotation Sensor: Difference between revisions
Jump to navigation
Jump to search
Keyestudio (talk | contribs) (→Result) |
Keyestudio (talk | contribs) No edit summary |
||
Line 34: | Line 34: | ||
==Result== | ==Result== | ||
<br>[[File:KS0349 20-2.png|800px|frameless|thumb]]<br> | <br>[[File:KS0349 20-2.png|800px|frameless|thumb]]<br> | ||
Done wiring and powered up, upload well the above code, then open the serial monitor and set the baud rate as 9600, finally you will see the analog value. If rotate the knob on the rotation sensor, the value will be changed within 0-1023. Shown below. | Done wiring and powered up, upload well the above code, then open the serial monitor and set the baud rate as 9600, finally you will see the analog value. If rotate the knob on the rotation sensor, the value will be changed within 0-1023. Shown below. | ||
<br>[[File:KS0349 20-3.png|800px|frameless|thumb]]<br> | <br>[[File:KS0349 20-3.png|800px|frameless|thumb]]<br> | ||
Revision as of 09:31, 27 May 2019
Introduction
This analog Rotation Sensor is arduino compatible. It is based on a potentiometer. Its voltage can be subdivided into 1024, easy to be connected to Arduino with our sensor shield. Combined with other sensors, we can make interesting projects by reading the analog value from the IO port.
Specification
- Supply Voltage: 3.3V to 5V
- Interface: Analog
Connection Diagram
Sample Code
void setup() { Serial.begin(9600); //Set serial baud rate to 9600 bps } void loop() { int val; val=analogRead(0);//Read rotation sensor value from analog 0 Serial.println(val,DEC);//Print the value to serial port delay(100); }
Result
Done wiring and powered up, upload well the above code, then open the serial monitor and set the baud rate as 9600, finally you will see the analog value. If rotate the knob on the rotation sensor, the value will be changed within 0-1023. Shown below.
Resources
- Video
http://video.keyestudio.com/ks0014/
- PDF and Code
https://drive.google.com/open?id=140QRHgX-oXiunYnw3zGGlHadwrULJfLK