Introduction
Specification
Documents
Product wikiShipping List
Num | Label | Description |
---|---|---|
1 | GND | GND |
2 | VCC | 4.8~7.2V |
3 | INPUT | PPM Signal |
4 | OUTPUT | Analog feedback |
Formula: Actual angle = Analog value degree *0.47-33.4
There will be some error between each servos. If you want to use the servos with scenes that require precise control, you can calibrate them separately. A quick three-point calibration method is provided here:
The following formula gives the relationship between Analog value & Angle:
If you doesn't need such accurate value, you can use m=0.47;n=-33.4 directly.
Hardware
Software
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
int pos = 0; // variable to store the servo position
uint16_t val;
double dat;
for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15);
val = analogRead(A0); //Connect Analog pin to A0
dat = (double)val * 0.47 - 33.4;
Serial.print("Position:"); //Display the position on Serial monitor
Serial.print(dat);
Serial.println("Degree"); // waits 15ms for the servo to reach the position
}
for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15);
val = analogRead(A0); //Connect Analog pin to A0
dat = (double)val * 0.47 - 33.4;
Serial.print("Position:"); //Display the position on Serial monitor
Serial.print(dat);
Serial.println("Degree"); // waits 15ms for the servo to reach the position
}
}
Arduino will drive the servo with D9 pin, and receive the Analog feedback from A0 port.
ชำระเงินค่าสินค้าโดยการโอนเงินเข้าบัญชีธนาคาร KBANK, SCB, BBL,TMB
กรุณาเก็บหลักฐานการโอนเงินของท่านไว้เพื่อแจ้งการชำระเงินด้วยค่ะ
ท่านสามารถแจ้งการชำระเงินผ่านระบบอัตโนมัติได้โดย Click Link ข้างล่างค่ะ
https://www.arduitronics.com/informpayment
หน้าที่เข้าชม | 15,393,408 ครั้ง |
ผู้ชมทั้งหมด | 5,896,486 ครั้ง |
เปิดร้าน | 21 พ.ค. 2556 |
ร้านค้าอัพเดท | 16 ก.ย. 2568 |