O'Reilly logo

Make an Arduino-Controlled Robot by Michael Margolis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix F. Arduino Pin and Timer Usage

The tables in this section show the pin and timer resources used by the projects in this book. You can use the same pin assignments for the Leonardo boards or the standard ATmega328 boards such as the Uno. However, there are subtle low level differences between these boards, so if you are adding capabilities that use additional pins or resources beyond those described in this book, then check the documentation on pin and resource usage for your board.

Handling Resource Conflicts

The Arduino chip has a rich collection of hardware resources, but you can run up against a conflict if a feature you are adding requires a hardware resource that some other feature is already using. A resource conflict occurs when a function reconfigures or requires exclusive access to some hardware capability. Running out of analog or digital pins is one kind of resource conflict, usually easy to spot.

More subtle is a conflict caused by a library that requires a resource such a hardware timer that is already used by some other function. For example, a motor shield uses PWM to control motor speed and each motor requires a timer component. Arduino tries to hide the underlying hardware (one of the things that makes it easy to use) but this can result in things going wrong when a resource conflict does occur. Sometimes the compiler will report a problem with an error message about a resource conflict. But sometimes the sketch will compile without an error message even ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required