C++ Library for $50 robot Version 2

Submitted by Webbot on January 1, 2009 - 10:12pm.

This tutorial is now deprecated as well because my WebbotLib library now allows you to use C++.

 

This tutorial replaces the one given earlier and has been expanded to include: UART,Software PWM, DC Motors, Logging, Sonars, Serial LCDs, Scheduling and other bits'n'pieces.

 

I will be posting some examples, both as source and as pre-compiled hex files, with my EZ-CD robot that shows how to use the majority of these classes.

 

The latest library can be downloaded here

 

UnZip this file to a new folder making sure that WinZip creates all the necessary sub-directories.

 

Once unzipped - edit the 'makefile' in the start folder. Change the following lines:-

MCU_TARGET = atmega8

F_CPU = 8000000

to reflect the target CPU and processor speed and then build the libraries by running 'make' from a DOS box in this folder.

 

NB If you are building for a number of different targets then you must run a 'make clean' and then edit the makefile as above, and then run 'make' again. The above settings must also match the equivalent settings in the makefile for your own code that uses the library.


The 'make' will create a library file called 'bin\cpplib.a' which may then be included in your own projects - see the makefile in the example projects for other compiler settings.

( categories: )