New answers tagged

1

As far as I can tell from the picture you share that you don't have an external power supply connect to the shield to drive the "12 DC motors". Read https://learn.adafruit.com/adafruit-motor-shield/power-requirements for better understanding on how to power the motors.


0

You are probably trying to load your code using Tools -> Burn Bootloader. Instead, you should use Sketch -> Upload, or shortcut CTRL + U or using the upload button:


1

Adafruit has a V1 and a V2 motor shield. They have different libraries too. AFMotor.h is for the V1 shield. From the error, I can tell you installed V2 lib. For that you need to include: #include <Adafruit_MotorShield.h>


1

The SmartInventor library is to be used with the Rokit Smart board. That board is based around the ATMega32. The Arduino Mega is not a Rokit Smart board, so the library will not work, since the Arduino Mega us based around the ATMega2560. The two chips are different, and have different sets of internal peripherals. So the registers have different names ...


0

Try different pins than 5 and 6, because those PWM generators share the timer with delay(), which I'd interpret as: You use analogWrite() to set the timer to fire every n microseconds to toggle your PWM signal -- and then you call delay(1000), which sets that same timer to fire in one second to continue the program. Pins 10 and 11 do use a different timer, ...


Top 50 recent answers are included