分享好友 模型图纸首页 模型图纸分类 切换频道

第三只机器手

2017-04-06 17:0232596下载
文件类型:压缩文件
文件大小:1.82M


// ThirdHand test script // by Tim Giles  //servo is on Pin8 //button is on Pin3 and has the pullup enabled #include  Servo ServoA; int Angle = 10; int AngleClosed = 10; int AngleOpen = 120; void setup() {  ServoA.attach(8);  pinMode(3,INPUT_PULLUP);} void loop() { //update the servo position ServoA.write(Angle);  delay(1); //check if the button is pushed if (digitalRead(3) == 0)  { //debounce while (digitalRead(3) == 0){      delay(1);    } //set the servo to it's open position Angle = AngleOpen;    ServoA.write(Angle); //hold the servo in this position to give the user time //to grab the screwdriver delay(2000); //set the servo to it's closed position Angle = AngleClosed;    ServoA.write(Angle);  }}




登录注册 后查看详情


举报
收藏 0
打赏 0
评论 0
  • 松鼠
  • 26下载297浏览19.78M