下載點
https://drive.google.com/file/d/0B_uh7-e5jDMcVHgwOHphNkFzeVk/edit?usp=sharing
伺服馬達校正
先使角度為 90度 再裝上超音波模組
// Controlling a servo position using a potentiometer (variable resistor)
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup()
{
myservo.attach(5); // attaches the servo on pin 9 to the servo object
}
void loop()
{
myservo.write(90); // sets the servo position according to the scaled value
delay(1500); // waits for the servo to get there
}
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。