Let's Make Robots!

Things that drive you mad!

Have you ever been stuck on a problem for hours or even days and then find that the answer was so simple?

I would like to make a collection of robot tips and tricks for when you get stuck. A list you can look at of all the stupid things you might have done. Hopefully by creating this list then in the future when you get stuck on a problem that just doesn't make sense you can read through it and solve your problem in just a few minutes.

I'm hoping everyone will add their experiences here to create a comprehensive list of silly mistakes to be avoided. To get the ball rolling I will start with some simple problems that had me stumped at first.

Software Problem: I was writting code for an Arduino Mega which has 4 serial ports but the compiler complained if I used anything other than the first serial port. I checked all my code twice, nothing was wrong.
I had the "board" setting set for an Arduino board that had only 1 serial port.

Software Problem: I was getting weird behaviour from my robot, the code was fine but values of a variable were jumping around a bit.
Solution: I had initialised a variable as a byte to save memory and then later changed the way I used that variable so that it's value exceeded the 0-255 limit of a byte. Changing the variable to an integer solved the problem.

Hardware Problem: My Spider controller worked fine with 16 servos but not 17 or more. I assumed the problem was my code or the board.
Solution: My battery holder and power cable were not heavy duty. Changing to a batterypack with heavy duty wires fixed the problem.

Software Problem: The Arduino IDE keeps complaining I have an invalid octal constant (WTF!!)
Solution: I had defined an IO pin with a 0 in front like this: "#define IOpin  09" instead of "#define IOpin  9"
The compiler saw the 0 in the front as an indication that the value was octal in which case 9 is an invalid number.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I wrote a tutorial how to set the fuses in a blank ATmega328P for use with Arduino IDE:


I just had it happen again. Funny thing is it is the bootloader that becomes corrupted. I have found that usually rewriting the bootloader once or twice fixes the problem.