Course Description

Art B2050, Fall 2013, DIAP at CCNY
A survey of modern electromechanical construction. Lessons interweave hardware, firmware, software and networking. Specific focus on paper and cardboard prototyping.

Wednesday, November 6, 2013

Week 10, 11/6: Debugging

So far we've seen all the ways a physical computing project can be difficult. Here's a troubleshooting checklist to help you figure out what's going wrong.

1. Is the code correct?
Code is the most complex and most edited part of a project, so it's the most likely source of a bug. This is why it's so important to keep your code clean and well-organized. Give each component its own function, keep variables local, and give the functions and variables obvious names. Use Serial.print() and Serial.println() liberally (then comment them out when you're done).

2. Did it work before you changed something?
If yes, isolate the change. Comment things out until you've located the problem. Save working versions of the code with clear version numbers (and don't save non-working versions). It may be that the newest change revealed an older bug, but that's less likely. If the code has never worked, and you're sure the code is right, check the wiring.

3. Is the wiring correct?
Visually inspect all soldered and solderless connections. Use the multimeter on the continuity setting to ensure conduction is happening where it's needed, and not happening elsewhere. Use the multimeter on the DC voltage setting to make sure the right amount of power is getting to each component. Isolate each component to make sure they're not interfering with each other.

No comments:

Post a Comment