本站改版新增arduino频道

Micropython
Arduino

arduino 倾斜角度模块


arduino 倾斜角度模块

/*

【雕爷学编程】Arduino动手做(11)

【Arduino】66种传感器模块系列实验之十四:倾斜传感器模块(角度开关)

实验源代码

*/



void setup()

{

    pinMode(3,INPUT); 

    pinMode(13,OUTPUT); 

}

 

void loop() {

  if (digitalRead(3)) {

    delay(100);

    digitalWrite(13,LOW);

  }

  else {

    digitalWrite(13,HIGH);

  }

}




推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 ESP56.com All Rights Reserved
晋ICP备14006235号-22 晋公网安备14108102001165号

执行时间: 0.0098288059234619 seconds