How to program grovepi under C language?


Is there any library under jessie (raspberry pi 3) + grovepi shield to use with C programming?
Library seems to exist under Python Language, but not for C language?!
Do we have to install IOT on the raspberrypi 3?



Yes there is an official grovepi C library.


thanks, but do you confirm that I need windows 10 IOT on my rbpi?

Hi @julien.launay,

You can program in C using our library that @graykevinb has posted with Raspbian Jessie itself, you will not need Windows 10 IOT for this. Have a look at the here to learn how to compile and execute C programs in Raspbian image.



Can you give me where I can find all the Api to read differents grove sensor, and the same for the motor for example.
Best regards.


Hi @julien.launay,

If you are using the GrovePi then the C library for it is here. However we might not have APIs written for specific sensors. If you have close watch at the library there are APIs for analogRead, analogWrite, digitalRead and digitalWrite. So based on the type of your sensor, you will have to build your own program. For instance you have an analog sensor and you want to read values from it, then use grovepi_analog_read.c.

Also you will not be able to use the Motors on GrovePi, we have a library and few commands in c to control the motors on GoPiGo here.



Do you have written API for I2C and UART grove sensor ? do you have a sample ?

Thanks to your help.

Your sincerely.


If you are specificially looking for the low lever I2C API calls in C, they are here .

For UART, there are examples in C like here.

We do not have any examples for Grove sensors using I2C or UART right now, however it should be easy enough to port them to C from python. Is there a specific sensor that want to get working in C?

hi there, i asked myself the same question and found a/my way to programm pi in c++. Don’t know if this could be a way for you but “c” istn “c++” so i dont know.

I dont wanted to use all that windows stuff… you can use for ex. netbeans.

feel free to help me with my actual prop: Button v1.2 / digitalRead

Hi @chkr,

I would take a look at the differences between C++ and C. They are different languages with different views on coding so I suggest you read pages like the following:

  1. What are the fundamental differences between C and C++? - Software Engineering Stack Exchange


  3. When to use C over C++, and C++ over C? - Software Engineering Stack Exchange

We currently support C++ for the GrovePi platform (and no longer C). Here’s a link to our source code and README:

Thank you!