Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in /home/w3348378/domains/sjriek.nl/public_html/wp-includes/class-wp-hook.php on line 298

programming

For programming the e-puck you need the c30 compiler from microchip.
As development environment the microchip MPLAB environment is most suited, as you will be able to debug through the ICD or pickkit programmers, but the standard environment only works on windows..
If you want your programming environment to run on Mac OS-X or Linux download the MPLABX environment which at the moment is still a beta release, this version also works under Windows.

Programming environment:

Select the Platform your are using
Select ”MPLAB IDE X” and ”MPLAB C30 Lite Compiler for dsPIC DSCs and PIC24 MCUs”
Download and install

Library’s:

The other tools and library’s that are needed can be found on both the e-puck website and the gctronic wiki.

get the latest library’s and tools from the e-puck website download->Software->Library->epucklib.zip

If you want the robots to communicate with each other over their infrared distance sensors you can install an additional library for that download->Software->Library->libircom-1.0.7.zip

The discription and usage of the available libraries is decribed in library/doc/html/index.html.

Starting a project in MPLABX:

File -> New Project
select Microchip embedded and C/ASM standalone Project
Family: Select DSPic30
Device: Select dsPIC30F6014A
Hardware tools: Select PICKit 3
Compiler Toolchain: Select C30
Give your project a name and Location

Add the needed library header files to you project Header Files

Add the needed library c files to your project Source Files
Add a new (main.c) file to your project , right click your project Source File and add new, in the main file don’t forget to include the needed header files. Compile your project by right clicking your project name and select build. If there are no compile errors the .hex file this is generated will be placed in /yourProjectDirectory/projectName.X/dist/default/production/projectName.production.HEX

Pairing of your robot:

before you can communicate over bluetooth with your robot you have to pair your robot first, the bluetooth passkey == e-puck robot number (eg 2203)

Uploading your code:

After you made a program and compiled it you need to upload the code (.hex) to the robot, for windows you can use a program called Tiny Bootloader , for linux and Mac OS-X there is a uploader in the epucklib.zip (tool->bootloader->computerSide) on Mac we use the multiplatform perl script ‘epuckupload’. Note that we experienced uploading problems with our Mac machines, there seem to be hardware /timing issues but only during uploading, not during normal bluetooth communication. Uploading therefore only works on mac OS-X when we use a bluetooth dongle with a Cambridge Silicon Radio chipset (eg. the Sitecom CN-516).
Upload your file by calling the epuckupload script from your console like this (with your own robot number).
perl epuckupload -f yourhexfile.hex /dev/tty.e-puck_2203-COM-1