User manual

4.1.2. Configure Syntax Highlighting.............................................56
4.1.3. Opening and compiling sample projects...............................58
4.2. Program upload to the RP6 ..................................................... 60
4.3. Why C? And what's “GCC”? .................................................... 61
4.4. C – Crash Course for beginners ............................................... 62
4.4.1. Literature.........................................................................62
4.4.2. First program...................................................................63
4.4.3. C basics...........................................................................65
4.4.4. Variables.........................................................................66
4.4.5. Conditional statements......................................................68
4.4.6. Switch-Case.....................................................................70
4.4.7. Loops..............................................................................71
4.4.8. Functions.........................................................................72
4.4.9. Arrays, Strings, Pointers....................................................75
4.4.10. Program flow and interrupts.............................................76
4.4.11. The C-Preprocessor.........................................................77
4.5. Makefiles .............................................................................. 78
4.6. The RP6 function library (RP6Library) ....................................... 79
4.6.1. Initializing the microcontroller.............................................79
4.6.2. UART Functions (serial interface)........................................80
4.6.2.1. Transmitting data ......................................................80
4.6.2.2. Receiving data ..........................................................82
4.6.3. Delay and timer functions..................................................83
4.6.4. Status LEDs and Bumpers..................................................86
4.6.5. Read ADC values (Battery, Motorcurrent and Light sensors)....91
4.6.6. ACS – Anti Collision System...............................................93
4.6.7. IRCOMM and RC5 Functions...............................................95
4.6.8. Power saving functions......................................................97
4.6.9. Drive system functions......................................................97
4.6.10. task_RP6System().........................................................103
4.6.11. I²C Bus Functions..........................................................104
4.6.11.1. I²C Slave ..............................................................104
4.6.11.2. I²C Master ............................................................107
4.7. Example Programs ............................................................... 111
5. Experiment Board ...................................................................... 123
6. Closing words ............................................................................ 124
APPENDIX .................................................................................... 125
A - Troubleshooting......................................................................125
B – Encoder calibration.................................................................133
C – Connector pinouts..................................................................135
D – Recycling and Safety instructions.............................................138