Skip to content

Commit

Permalink
현물제작 최종 디버깅 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
GgobukGgobuk committed Aug 21, 2023
1 parent 8af7e49 commit 76ae721
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions mcu/Arduino_code/Arduino_Servo_Serial/Arduino_Servo_Serial.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <Servo.h>


Servo servo1;
Servo servo2;

void setup(){
servo1.attach(3);
servo2.attach(5);
servo1.write(30);
servo2.write(130);
Serial.begin(9600);

}

void loop()
{
if(Serial.available()){
char ch = Serial.read();
switch(ch){
case 'd' :

servo1.write(30);
servo2.write(130);

break;

case 'u':
servo1.write(120);
servo2.write(30);

break;
}
}
}

0 comments on commit 76ae721

Please sign in to comment.