How to program grovepi under C language?

Hello,

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?

Thanks.

julien

Yes there is an official grovepi C library.
https://github.com/DexterInd/GrovePi/tree/master/Software/C

Hello,

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

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 README.md here to learn how to compile and execute C programs in Raspbian image.

-Shoban

Hello,

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.

Julien

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.

-Shoban

Hello,

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

Thanks to your help.

Your sincerely.

Julien

@julien.launay,
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

  2. http://www.diffen.com/difference/C_vs_C%2B%2B

  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!