ขาย โมดูลตัวต้านทานปรับค่าได้ 10K resistance potentiometer module adjustable resistance module single-turn adjustable ana... ราคาที่ดีที่สุด
5
6
การให้คะแนน
5
ขายแล้ว
฿40
เรือจาก | จังหวัดภูเก็ต |
---|
รายละเอียดสินค้า
Potentiometer module Adjustable resistance module 10K resistance value Single turn adjustable Analog output 0-5V voltage
ตัวอย่างการต่อกับ Arduino Uno
ตัวอย่างโปรแกรม
int sensorPin = A0; // select the input pin for the potentiometer
int ledPin = 13; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor
void setup() {
// declare the ledPin as an OUTPUT:
pinMode(ledPin, OUTPUT);
}
void loop() {
// read the value from the sensor:
sensorValue = analogRead(sensorPin);
// turn the ledPin on
digitalWrite(ledPin, HIGH);
// stop the program for sensorValue milliseconds:
delay(sensorValue);
// turn the ledPin off:
digitalWrite(ledPin, LOW);
// stop the program for for sensorValue milliseconds:
delay(sensorValue);
}