Red: pressure-wire
Brown: Ground lead
Orange: signal wire
Model: SG90
Technical data given by the manufacturers:
Size: 21.5mmX11.8mmX22.7mm
Weight: 9 grams
No-load speed: 0.12 seconds / 60 degrees (4.8V)
Stall torque of 1.2 - 1.4 kg / cm (4.8V)
Operating temperature: -30 to +60 degrees Celsius
Dead-set: 7 microseconds
Operating voltage: 4.8V-6V
ตัวอย่าง
#include <Servo.h>
#define servo_tray_pin 5 // tray card
Servo servo_tray;
void setup() {
pinMode(servo_tray_pin,OUTPUT);
servo_tray.attach(servo_tray_pin);
servo_tray.write(0);
delay(100);
}
void loop()
{
servo_tray.write(0);
delay(2000);
servo_tray.write(90);
delay(2000);
}
|