Support » Pololu AVR C/C++ Library User’s Guide »
1. Introduction
<p>This document is a guide to using the Pololu AVR C/C++ library, including installation instructions, tutorials, and example programs. The Pololu AVR Library makes it easy for you to get started with the following Pololu products:</p>
<p><!-- this table is copied from document 0J18 -->
<table><tr>
<th style="padding-right: 1em; width: 100px;">
<table class="picture_with_caption center"><tr><td><img alt="" class="" data-gallery-pictures="[{"id":"0J830","caption":"\u003cp\u003ePololu 3pi robot.\u003c/p\u003e","url_tiny":"https://a.pololu-files.com/picture/0J830.98x98.jpg?3d1b50d88a13c3275a836c3a7c139f0b","url_medium":"https://a.pololu-files.com/picture/0J830.600x480.jpg?3d1b50d88a13c3275a836c3a7c139f0b","url_full":"https://a.pololu-files.com/picture/0J830.1200.jpg?3d1b50d88a13c3275a836c3a7c139f0b","longest_side":800}]" data-picture-id="0J830" data-picture-longest_side="800" src="https://a.pololu-files.com/picture/0J830.80.jpg?3d1b50d88a13c3275a836c3a7c139f0b" /></td></tr></table></p>
</th>
<td>
<p><strong><a href="/product/975">Pololu 3pi robot</a>:</strong> a mega168/328-based programmable robot. The 3pi robot essentially contains an SV-328 and a 5-sensor version of the QTR-8RC, both of which are in the list below.</p>
</td>
</tr>
<tr>
<th style="padding-right: 1em;">
<table class="picture_with_caption center"><tr><td><img alt="" class="" data-gallery-pictures="[{"id":"0J1882","caption":"\u003cp\u003ePololu Orangutan SVP.\u003c/p\u003e","url_tiny":"https://a.pololu-files.com/picture/0J1882.98x98.jpg?c9034725d7f1d5e72ca932d6fdd521ec","url_medium":"https://a.pololu-files.com/picture/0J1882.600x480.jpg?c9034725d7f1d5e72ca932d6fdd521ec","url_full":"https://a.pololu-files.com/picture/0J1882.1200.jpg?c9034725d7f1d5e72ca932d6fdd521ec","longest_side":800}]" data-picture-id="0J1882" data-picture-longest_side="800" src="https://a.pololu-files.com/picture/0J1882.80.jpg?c9034725d7f1d5e72ca932d6fdd521ec" /></td><p></tr></table></p>
</th>
<td>
<p><strong><a href="/product/1327">Pololu Orangutan SVP-1284</a>:</strong> based on the mega1284, the SVP-1284 is our newest Orangutan robot controller. It is a super-sized version of the SV-328, with a built-in AVR ISP programmer, more I/O lines, more regulated power, and more memory. It also features hardware that makes it easy to control up to eight servos with a single hardware PWM and almost no processor overhead.</p>
</td>
</tr>
<tr>
<th style="padding-right: 1em;">
<table class="picture_with_caption center"><tr><td><img alt="" class="" data-gallery-pictures="[{"id":"0J1882","caption":"\u003cp\u003ePololu Orangutan SVP.\u003c/p\u003e","url_tiny":"https://a.pololu-files.com/picture/0J1882.98x98.jpg?c9034725d7f1d5e72ca932d6fdd521ec","url_medium":"https://a.pololu-files.com/picture/0J1882.600x480.jpg?c9034725d7f1d5e72ca932d6fdd521ec","url_full":"https://a.pololu-files.com/picture/0J1882.1200.jpg?c9034725d7f1d5e72ca932d6fdd521ec","longest_side":800}]" data-picture-id="0J1882" data-picture-longest_side="800" src="https://a.pololu-files.com/picture/0J1882.80.jpg?c9034725d7f1d5e72ca932d6fdd521ec" /></td><p></tr></table></p>
</th>
<td>
<p><strong><a href="/product/1325">Pololu Orangutan SVP-324</a>:</strong> based on the mega324, the SVP-324 is a version of the SVP-1284 with less memory. The two versions are completely code-compatible (the same code will run on both devices as long as it’s small enough to fit on the ATmega324PA).</p>
</td>
</tr>
<tr>
<th style="padding-right: 1em;">
<table class="picture_with_caption center"><tr><td><img alt="" class="" data-gallery-pictures="[{"id":"0J103","caption":"\u003cp\u003ePololu Orangutan X2 Robot Controller.\u003c/p\u003e","url_tiny":"https://a.pololu-files.com/picture/0J103.98x98.jpg?4a2be1b5d77209343a75bf1313e39445","url_medium":"https://a.pololu-files.com/picture/0J103.600x480.jpg?4a2be1b5d77209343a75bf1313e39445","url_full":"https://a.pololu-files.com/picture/0J103.1200.jpg?4a2be1b5d77209343a75bf1313e39445","longest_side":640}]" data-picture-id="0J103" data-picture-longest_side="640" src="https://a.pololu-files.com/picture/0J103.80.jpg?4a2be1b5d77209343a75bf1313e39445" /></td><p></tr></table></p>
</th>
<td>
<p><strong><a href="/product/738">Pololu Orangutan X2</a>:</strong> based on the mega1284, the X2 robot controller is the most powerful Orangutan. It features an auxiliary microcontroller devoted to controlling much of the integrated hardware (it also acts as a built-in AVR ISP programmer) and high-power motor drivers capable of delivering hundreds of watts.</p>
</td>
</tr>
<tr>
<th style="padding-right: 1em;">
<table class="picture_with_caption center"><tr><td><img alt="" class="" data-gallery-pictures="[{"id":"0J1138","caption":"\u003cp\u003ePololu Orangutan SV-168.\u003c/p\u003e","url_tiny":"https://a.pololu-files.com/picture/0J1138.98x98.jpg?103c362fdd82787d7a13da2bb5ac28c4","url_medium":"https://a.pololu-files.com/picture/0J1138.600x480.jpg?103c362fdd82787d7a13da2bb5ac28c4","url_full":"https://a.pololu-files.com/picture/0J1138.1200.jpg?103c362fdd82787d7a13da2bb5ac28c4","longest_side":800}]" data-picture-id="0J1138" data-picture-longest_side="800" src="https://a.pololu-files.com/picture/0J1138.80.jpg?103c362fdd82787d7a13da2bb5ac28c4" /></td><p></tr></table></p>
</th>
<td>
<p><strong><a href="/product/1227">Pololu Orangutan SV-328</a>:</strong> a full-featured, mega328-based robot controller that includes an LCD display. The SV-328 runs on an input voltage of 6-13.5V, giving you a wide range of robot power supply options, and can supply up to 3 A on its regulated 5 V bus. This library also supports the original <a href="/product/1225">Orangutan SV-168</a>, which was replaced by the SV-328.</p>
</td>
</tr>
<tr>
<th style="padding-right: 1em;">
<table class="picture_with_caption center"><tr><td><img alt="" class="" data-gallery-pictures="[{"id":"0J64","caption":"\u003cp\u003eThe Orangutan LV-168 attached to a 3-AA battery holder.\u003c/p\u003e","url_tiny":"https://a.pololu-files.com/picture/0J64.98x98.jpg?60041cfe365e7c7e191c9e5d4260be91","url_medium":"https://a.pololu-files.com/picture/0J64.600x480.jpg?60041cfe365e7c7e191c9e5d4260be91","url_full":"https://a.pololu-files.com/picture/0J64.1200.jpg?60041cfe365e7c7e191c9e5d4260be91","longest_side":1024}]" data-picture-id="0J64" data-picture-longest_side="1024" src="https://a.pololu-files.com/picture/0J64.80.jpg?60041cfe365e7c7e191c9e5d4260be91" /></td><p></tr></table></p>
</th>
<td>
<p><strong><a href="/product/775">Pololu Orangutan LV-168</a>:</strong> a full-featured, mega168-based robot controller that includes an LCD display. The LV-168 runs on an input voltage of 2-5V, allowing two or three batteries to power a robot.</p>
</td>
</tr>
<tr>
<th style="padding-right: 1em;">
<table class="picture_with_caption center"><tr><td><img alt="" class="" data-gallery-pictures="[{"id":"0J661","caption":"\u003cp\u003eBaby Orangutan B-48/B-168/B-328.\u003c/p\u003e","url_tiny":"https://a.pololu-files.com/picture/0J661.98x98.jpg?b09cb6fd7b8b5eae7660c7f643a03f48","url_medium":"https://a.pololu-files.com/picture/0J661.600x480.jpg?b09cb6fd7b8b5eae7660c7f643a03f48","url_full":"https://a.pololu-files.com/picture/0J661.1200.jpg?b09cb6fd7b8b5eae7660c7f643a03f48","longest_side":800}]" data-picture-id="0J661" data-picture-longest_side="800" src="https://a.pololu-files.com/picture/0J661.80.jpg?b09cb6fd7b8b5eae7660c7f643a03f48" /></td><p></tr></table></p>
</th>
<td>
<p><strong><a href="/product/1215">Pololu Baby Orangutan B-48</a>:</strong> a compact, complete robot controller based on the mega48. The B-48 packs a voltage regulator, processor, and a two-channel motor-driver into a 24-pin DIP format.</p>
</td>
</tr>
<tr>
<th style="padding-right: 1em;">
<table class="picture_with_caption center"><tr><td><img alt="" class="" data-gallery-pictures="[{"id":"0J659","caption":"\u003cp\u003eBaby Orangutan B PCB bottom with quarter for size reference.\u003c/p\u003e","url_tiny":"https://a.pololu-files.com/picture/0J659.98x98.jpg?158329f1bbba13f019de6d060e10d98c","url_medium":"https://a.pololu-files.com/picture/0J659.600x480.jpg?158329f1bbba13f019de6d060e10d98c","url_full":"https://a.pololu-files.com/picture/0J659.1200.jpg?158329f1bbba13f019de6d060e10d98c","longest_side":400}]" data-picture-id="0J659" data-picture-longest_side="400" src="https://a.pololu-files.com/picture/0J659.80.jpg?158329f1bbba13f019de6d060e10d98c" /></td><p></tr></table></p>
</th>
<td>
<p><strong><a href="/product/1220">Pololu Baby Orangutan B-328</a>:</strong> a mega328 version of the above. The mega328 offers more memory for your programs (32 KB flash, 2 KB RAM). This library also supports the <a href="/product/1216">Baby Orangutan B-168</a>, which was replaced by the Baby B-328.</p>
</td>
</tr>
<tr>
<th style="padding-right: 1em;">
<table class="picture_with_caption center"><tr><td><img alt="" class="" data-gallery-pictures="[{"id":"0J624","caption":"\u003cp\u003eQTR-1A reflectance sensor.\u003c/p\u003e","url_tiny":"https://a.pololu-files.com/picture/0J624.98x98.jpg?ee600c4d729adedc3c8bbc8c4c4ff68c","url_medium":"https://a.pololu-files.com/picture/0J624.600x480.jpg?ee600c4d729adedc3c8bbc8c4c4ff68c","url_full":"https://a.pololu-files.com/picture/0J624.1200.jpg?ee600c4d729adedc3c8bbc8c4c4ff68c","longest_side":671}]" data-picture-id="0J624" data-picture-longest_side="671" src="https://a.pololu-files.com/picture/0J624.80.jpg?ee600c4d729adedc3c8bbc8c4c4ff68c" /></td><p></tr></table></p>
</th>
<td>
<p><strong><a href="/product/958">Pololu QTR-1A</a> and <a href="/product/960">QTR-8A</a> reflectance sensors (analog):</strong> an analog sensor containing IR/phototransistor pairs that allows a robot to detect the difference between shades of color. The QTR sensors can be used for following lines on the floor, for obstacle or drop-off (stairway) detection, and for various other applications.</p>
</td>
</tr>
<tr>
<th style="padding-right: 1em;">
<table class="picture_with_caption center"><tr><td><img alt="" class="" data-gallery-pictures="[{"id":"0J615","caption":"\u003cp\u003eQTR-8A reflectance sensor array.\u003c/p\u003e","url_tiny":"https://a.pololu-files.com/picture/0J615.98x98.jpg?ef5903b25450c25de151ed9b43d1fce3","url_medium":"https://a.pololu-files.com/picture/0J615.600x480.jpg?ef5903b25450c25de151ed9b43d1fce3","url_full":"https://a.pololu-files.com/picture/0J615.1200.jpg?ef5903b25450c25de151ed9b43d1fce3","longest_side":800}]" data-picture-id="0J615" data-picture-longest_side="800" src="https://a.pololu-files.com/picture/0J615.80.jpg?ef5903b25450c25de151ed9b43d1fce3" /></td><p></tr></table></p>
</th>
<td>
<p><strong><a href="/product/959">Pololu QTR-1RC</a> and <a href="/product/961">QTR-8RC</a> reflectance sensors (RC):</strong> a version of the above that is read using digital inputs; this is compatible with the Parallax QTI sensors.</p>
</td>
</tr>
<tr>
<th style="padding-right: 1em;">
<table class="picture_with_caption center"><tr><td><img alt="" class="" data-gallery-pictures="[{"id":"0J1203","caption":"\u003cp\u003eEncoder for Pololu wheel 42\u0026#215;19mm with wheel, motor, and bracket.\u003c/p\u003e","url_tiny":"https://a.pololu-files.com/picture/0J1203.98x98.jpg?75503cf18b0c2ec3f08cbe089cd7f3b3","url_medium":"https://a.pololu-files.com/picture/0J1203.600x480.jpg?75503cf18b0c2ec3f08cbe089cd7f3b3","url_full":"https://a.pololu-files.com/picture/0J1203.1200.jpg?75503cf18b0c2ec3f08cbe089cd7f3b3","longest_side":800}]" data-picture-id="0J1203" data-picture-longest_side="800" src="https://a.pololu-files.com/picture/0J1203.80.jpg?75503cf18b0c2ec3f08cbe089cd7f3b3" /></td><p></tr></table></p>
</th>
<td>
<p><strong><a href="/product/1217">Encoder for Pololu Wheel 42×19 mm</a>:</strong> a wheel encoder solution that allows a robot to measure how far it has traveled.</p>
</td>
</tr>
</table>
<p>For detailed information about all of the functions available in the library, see the <strong><a href="/docs/0J18">command reference</a></strong>.</p>
<p>Note that the library is designed for Atmel’s AVR-based boards like the Orangutans: to use it with the QTR sensors, your controller must be either an Orangutan or another board built with an ATmega48/168/328P or ATmega324PA/644P/1284P AVR microcontroller.</p>
<p>This document covers use of the library in a C/C++ programming environment. Some parts of the library can also be used in the <a href="http://www.arduino.cc">Arduino</a> IDE. See our <a href="/docs/0J17">guide to using Arduino with Orangutan controllers</a> for more information.</p>
<p>If you want to control a Pololu QTR reflectance sensor with an Arduino, please see our <a href="/docs/0J19">Arduino Library for the Pololu QTR Reflectance Sensors</a>.</p>