Loading
Loading
IoT Lab content is currently available in Arabic only. We're working on an English version.
عرض بالعربية →Reading gradual values instead of just 0 and 1.
Right leg to 5V, left leg to GND, and the middle leg to pin A0.
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(A0);
Serial.println(sensorValue); // يعرض القيم من 0 لـ 1023
delay(100);
}Connecting the middle leg to 5V and a side leg to A0, which will either result in a fixed reading or a short circuit when the knob is turned all the way.