水帖(无干货)1 Feb 7, 2021 14:29:23 GMT Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by 卢占卡 on Feb 7, 2021 14:29:23 GMT 一.接线原理图一.实物图三.事例代码从0转180度,再从180转到0度(pos<=或是pos>=后面的数字就是角度,如180度,可以自行修改)代码如下:#include<Servo.h>Servo myservo;int pos=0;void setup() { // put your setup code here, to run once: myservo.attach(9);}void loop() { // put your main code here, to run repeatedly: for(pos=0;pos<=180;pos+=1){ myservo.write(pos); } for(pos=180;pos>=1;pos-=1){ myservo.write(pos); }}
水帖(无干货)1 Feb 7, 2021 14:31:23 GMT Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by 卢占卡 on Feb 7, 2021 14:31:23 GMT 以上内容为9G舵机,拒绝喷子,从你我做起