Servo Motor SG90 control tutorial - Arduino Nano - Code included
HTML-код
- Опубликовано: 10 ноя 2024
- Download the code from the link:
www.mediafire.c...
Analog servo motors are inexpensive little powerhouses that can be perfect when you're designing something that needs to move. They pack a lot of torque for their size and their shaft position can be pretty accurately controlled.
Parts used:
1x Breadboard
1x Arduino Nano
3x Jumper Wires (male-male)
1x SG90 Servo Motor
Facebook: / lot10games
Instagram: / 1indie_game_dev
Hi everyone. To those of you who have watched the video and cannot seem to make the servo motor rotate, here is the fix. In the code provided, the owner uses digital pin 7 to connect to the servo motor. However, a servo motor needs Pulse Width Modulation (PWM) signal to rotate, and in this case, the digital pin 7 is not a PWM pin.
To fix, you can use the digital pin 3 instead, which is a PWM pin. In the " int servoPin = 7; " command line, change number 7 to 3. Now compile and connect the servo motor to digital pin 3. It should be able to rotate now.
thanks a lot for your help!
can the nano also be used to trigger the servo with a push button?
Yes
@@lot10games how
@@karlsaariste using a button , of course. You can find tutorials on RUclips
error avrdude: stk500_recv(): programmer is not responding
Make sure that the correct port is selected
apparently my arduino couldn’t process the code, do you have any idea of how to fix this?
What error do you have?
👍👍
Like
new sub
спасибо
Пожалуйста
gAmEr
Like