- 机器人等级考试
机器人五级 analogRead
- 2025-6-21 13:46:09 @
const int potPin = 4;
void setup() {
// put your setup code here, to run once:
pinMode(potPin,INPUT);
Serial.begin(115200);
Serial.println("hello world");
analogSetWidth(10);
}
int val;
void loop() {
val = analogRead(potPin);
Serial.print("电位器的数值是:");
Serial.println(val);
delay(20);
}
4 条评论
-
admin SU @ 2025-6-21 13:48:38
-
2025-6-21 13:48:21@
-
2025-6-21 13:47:09@
-
2025-6-21 13:46:40@
- 1