When I Use Servo.WriteMillisecond function nothing happened to the Servo.
Also when I connect to D9 the servo automatically starts rotating even when I haven’t attached them in the program.
Please can anyone suggest iam I doing something wrong or is the servo Lib not meant for Arduino Nano?
Servos do not need to be connected to PWM pins. Using the Servo library you can use any Arduino pin to drive a servo as long as it is not being used for something else.
To use the Servo Library the above Pins Map to pin 8,9,12, 13
Are you confusing the numbers of the actual pins on the chip with those on Arduino board ? As you are you using a Nano Arduino clone it would seem logical to use the Arduino pin numbers.
Which Arduino pin do you have the servo attached to ?
The power to Servo is from a step Down buck converter, and the power to Arduino is from another step Down buck converter.
But both the buck converter are powered from same Lipo battery so I think that should work, Hope I am write ?
Hi UKHeliBob,
The number on Arduino nano where the servo signal is attached is D5,D6,D9 and D10
And in the program I am using
Servo.attach(8)
Servo.attach(9)
Servo.attach(12)
Servo.attach(13)
As you are using Arduino pins 5, 6, 9 and 10 can I suggest that your code should attach the servos to those pins and not 8, 9, 12 and 13 ? As I said before
Are you confusing the numbers of the actual pins on the chip with those on Arduino board ? As you are you using a Nano Arduino clone it would seem logical to use the Arduino pin numbers.
I should also point out that you need a different name for each servo object
In the sketch (program) code you should use those pin numbers exactly printed on the Arduino board.
Its your choise to use ANY of the analog pins (those starting with the letter "A") or the digital pins (those NOT starting with a letter).
In your sketch you can define ANY of these pins as a digital input or a digital ouput. It depends on your code.
Dont worry about the pin numbers on the chip itself, as this has been taken care of in the compiler, when using the onboard printed pin numbers.
Thats one big advantage using the Arduino boards, they always use the same pin numbers printed on the board, being it an Uno, Nano or Micro.
I had exactly the same confusion with my first code, until I understood, that you get the right pin no & type, if simply following the Arduino board pin text.