- Notifications
You must be signed in to change notification settings - Fork0
EV3-API for Programming the LEGO Mindstorms EV3 in C
simonedegiacomi/EV3-API
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This API supports the following functionalities:
- Controlling LEGO motors
- Reading from the following sensors:
- Touch
- Ultrasonic
- Color
- Gyro
- Infrared
- HiTechnic Color Sensor V2
- HiTechnic Compass Sensor
- HiTechnic Infrared Sensor
- NXT Temperature
- NXT Sound
- Pixy Cam
- Controlling Buttons and LEDs
- Printing text on LCD
- Playing sounds and audio files
In order to compile a program that uses this library, or to rebuild this library, you need a compatible ARM toolchain.You can download the one from theofficial c4ev3 repository.
Download library from thereleases page. Each releases consist of azip file that contains aninclude
folder, with all the headers, and alib
folder, which contains the built static library.There are two versions of static library: glibc and uclibc. While compiling, specify the right version to use according to your compiler.
If you are using the toolchain from c4ev3, use the uclibc version.
Create now a new file:
// hello.c#include<ev3.h>intmain () {InitEV3();LcdTextf(LCD_COLOR_BLACK,0,0,"Hello world!");Wait(5000);FreeEV3();return0;}
Then compile it with:
arm-c4ev3-linux-uclibcgnueabi-gcc hello.c -I /path/to/c4ev3/include -L /path/to/c4ev3/include/lib/uclibc -lev3api
or with (if you're using a glibc compiler)
arm-linux-gnueabi-gcc hello.c -I /path/to/c4ev3/include -L /path/to/c4ev3/include/lib/glibc -lev3api
Finally, useev3duder to upload the program to the robot.
You can find the documentation here:https://simonedegiacomi.github.io/EV3-API/files.html
About
EV3-API for Programming the LEGO Mindstorms EV3 in C
Resources
Stars
Watchers
Forks
Packages0
Languages
- C98.1%
- C++1.2%
- Other0.7%