Preface: I am fairly new to Arduino / micro-controllers but have been a software developer for 10+ years.
I read many posts that discourage from connecting a DC motor to the Arduino board directly and especailly not with USB 1 & 2
Being careful and only connecting the mega2560 board to a battery and only for one min or so, I was able to get this motor running using the following methods:
1) digitalWrite 50pin and 52pin HIGH and LOW and reverse.
2) analogWrite to PWM 13pin and Grn.
3) analogWrite to PMW 13pin with range from 0 to 255 for speed control.
My question is:
Supposing I want to use this chasis to build a simple robot, and knowing that this motor only has two connections, how can I build a circuit such as the one here onto that chasis?
My confusion is since the motor connections will go to 5V and Grd on the POWER side of the board to control direction, how can I control speed? Also how can I ensure not to burn my chip in long term use?
Finally, just a note of sharing (and bragging) I was able to get this sensor to work off the PWM pins also and wrote a quick and dirty script to account for noise using Bayes Rule in preparation for a fully autonomous Robot! So far very happy with Arduino!
I assume that your question "how can I build a circuit such as the one here onto that chasis?" Centers around how to add such a circuit without using the prototype board. The best choice would be stripboard.
How are they doing so without a stripboard? I looked at their source code on github and those 9 and 10 pins (orange ports in image) do the same thing as a digital and analogWrite. That orange piece is soldered onto the board (I have it in-front of me).