Подключение сервопривода к роботу Arduino (фирменному)C++

Программы на C++. Форум разработчиков
Ответить
Anonymous
 Подключение сервопривода к роботу Arduino (фирменному)

Сообщение Anonymous »


I am trying to attach a servo on an Arduino (branded) Robot but not sure whhich pin to use for the bellow code. Most people seem to recommend to use pin 9 and 10 to control the servo for arduino Unos. However, I can't use Pin 9 because that is already used as the Slave Select pin for the LCD. I have tried attaching it to pins TKD0-TKD3 by calling them pins 19-22 in myservo.attach(). The code runs but the servo doesn't rotate and only gets hot and/or twitches.

Could the problem be something other than incorrect pin connection?
Thanks,
I have been referencing these for the Control board pin mapping: http://arduino.cc/en/Main/Robot) http://fabcirablog.weebly.com/blog/grap ... trol-board
#include Servo myservo; // create servo object to control a servo int pos = 0; void setup() { myservo.attach(19); // attaches the servo on pin 9 to the servo object } void loop() { for(pos = 0; pos < 60; pos += 1) { myservo.write(pos); delay(15); } for(pos = 60; pos>=1; pos-=1) { myservo.write(pos); delay(15); } }

Источник: https://stackoverflow.com/questions/259 ... nded-robot
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C++»