const int potPin = 34;
const int LED = 27;
int val=0;
void setup() {
Serial.begin(115200);// 连接速率
pinMode(LED, OUTPUT);// 27脚设定维输出
  delay(1000);
}

void loop() {
//put your main code here, to run repeatedly:
val = analogRead(potPin);// 读取电压资料
Serial.println(val);// 印出电压量化资料
  if (val > 1000)
  {
  digitalWrite(LED, HIGH); //LED点亮
  } 
  else 
  {
   digitalWrite(LED, LOW); //LED熄灭
  }
 
 delay(500);// 延迟0.5秒
}
