Tower Pro SG90 Micro Servo (SG90) [D018]
https://www.youtube.com/watch?v=qdUgJtBClZ4
* GitHub : https://github.com/rdiot/rdiot-d018.git
* Specs
Speed: 0.12 second / 60 degrees rotation
Torque: 1.2-1.4kg @ 4.8V~6V power
Comes with full ranged connectivity accessories and mounting screws
Working temperature: -30 to +60 degrees Celsius
Dead band setting: 7 microseconds
- Connect
Brown - GND
Red - 5V
Orange - D12
- Key Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>
LiquidCrystal_I2C lcd(0x27,20,4); // LCD2004
Servo myservo;
int servoPin = 12;
int pos = 0;
void setup()
{
lcd.init(); // initialize the lcd
lcd.backlight();
lcd.print("start LCD2004");
myservo.attach(servoPin);
delay(1000);
lcd.clear();
}
void loop()
{
lcd.setCursor(0,0);
lcd.print("D018:SG90 Servo");
for(pos = 0; pos < 180; pos += 1)
{
myservo.write(pos);
lcd.setCursor(0,1);
lcd.print("pos0~179=" + (String)pos + " " );
delay(0); // Control Speed by delay time.
}
for(pos = 180; pos>=1; pos-=1)
{
myservo.write(pos);
lcd.setCursor(0,2);
lcd.print("pos180~1=" + (String)pos + " " );
delay(0);
}
}
'3) Actuator > Motor' 카테고리의 다른 글
TowerPro SG5010 Micro Servo (SG5010) [D032] (0) | 2016.10.04 |
---|---|
SG90 Camera Mount [B051] (0) | 2016.10.04 |
Helicopter Coreless DC Motor [S143] (0) | 2016.09.30 |
DC6~12V R030 Biaxial Double Axis DC Motor (R030) [D067] (0) | 2016.09.30 |
9376 Motor Miniatura (9376) [D019] (0) | 2016.09.30 |