วัสดุ
1.ไม้อัด
2.บอร์ด nano
1.ไม้อัด
2.บอร์ด nano
3.ฐานบอร์ด nona แบบไหนก็ได้
4.เซอโว
5.สวิทซ์คันโยก
4.เซอโว
5.สวิทซ์คันโยก
6.โมดูลสวิทซ์
7.แบต18650 เพราะวงจรแปลงไฟ
8.สายUSB
8.สายUSB
การต่อวงจร
โค้ด
const int buttonPin = 6;int buttonState = 0;
#include <Servo.h>
Servo myservo;
void setup() {
pinMode(buttonPin, INPUT);
myservo.attach(A1);
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
myservo.write(0);
} else {
myservo.write(60);
}
}
ดี
ตอบลบAn error occurred while uploading the sketch
ตอบลบavrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x0a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x0a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x0a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x0a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x0a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x0a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x0a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x0a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x0a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x0a
แก้ยังไงครับ???