void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
// 串口 设置波特率 1 <=> 1
Serial.begin(115200);
}
void loop() {
Serial.println(millis());
int attenVal = analogRead(A0); // [0,1023]
// Serial.println(attenVal);
int ledLight = map(attenVal,0,1023,36,255);
// 38
analogWrite(13, ledLight); // [37,255] => [0%,100%]
}