SG901 서보모터 SG90 부품 특성 : 코드 : #include #define PIN_PWM 9 #define MIN 0 #define MAX 180 #define MODE 0 void UpAndDown(); void OrderBySerial(); void setMode(int mode); Servo moter; String readString; String wBuf; int theta=0; int step = 5; void (*func)() = UpAndDown; void setup() { Serial.begin(9600); moter.attach(PIN_PWM, MIN,MAX); moter.writeMicroseconds(20); setMode(0); } void setMode(int mode) { switch(mode) {.. 아두이노 2022. 1. 17. 이전 1 다음