Demo entry 6631526

voidsetup()// run once, when the sketch starts{pinMode(2,INPUT);//设定管脚2是输入信号。pinMode(13,OUTPUT);// 这个管脚的有啥特殊前面说了，好好回忆一下。}voidloop()// run over and over again{intv=digitalRead(2);//读入二号管脚的值if(v==1){//如果是高电平 1digitalWrite(13,HIGH);}else{//如果是低电平0digitalWrite(13,LOW);}}