Rotating Module
59.00৳
Rotating module, electronic constructor, encoder
In stock
Description
Characteristics:
•High quality rotary electric appliance, stable performance smooth movement
•Output 0 – VCC analog voltage signal
Specification:
1.Size: 26*20mm
2.Weight: 5g
3.Voltage: 3.3V, 5V
4.Port: Analog
5.Resistance: 100K
6.Rotation angle: 270 degrees
7.Platform: Arduino, MCU, ARM, Raspberry Pi
Connect the S port of the rotating potentiometer electronic block to the A0 end of the Arduino plate,and use the following program to read its simulation value.Through the simulation value to set the LED brightness.
const int led = 9; // the pin that the LED is attached to
int brightness = 0; // how bright the LED is
void setup() {
// declare pin 9 to be an output:
pinMode(led, OUTPUT);
}
void loop() {
brightness = analogRead(A0); //use A0 to read the electrical signal
brightness = map(brightness, 0, 1023, 0, 255);
// set the brightness of pin 9:
analogWrite(led, brightness);
}
Only logged in customers who have purchased this product may leave a review.
Reviews
There are no reviews yet.