User avatar
artiny
Posts: 46
Joined: Fri Feb 12, 2016 10:38 pm
Location: slovakia

Sensors with C++ sensor library?

Mon May 02, 2016 11:28 am

Hy,
I would like to buy sensors,which are avaible C++ library....could someone me add advice, who is used before some sensors with c++ library and was easy to use it :roll:

I need (not integrated for exl. accelero+gyro, or temperature+barometer.......I need it separately):
-accelerometer
-gyroscope
-analog temperature sensor
-barometer
-gps modul

THANK YOU

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: Sensors with C++ sensor library?

Mon May 02, 2016 2:42 pm

hello,
I am using some of the sensors you mentioned by myself, maybe you wish to look here:

CMPS11: 9D IMU == 3D Gyro + 3D Compass + 3D Accelerometer (by I2C):
http://www.mindstormsforum.de/viewtopic ... 815#p67909

as a GPS I have the GY-NEO-6M V2 (by UART) - I have no Raspberry USB/UART code (I use it on Arduino), but I was told it would work:
http://www.mindstormsforum.de/viewtopic ... =15#p67458


about Analog sensors:
The Raspi has no ADC port, so you'd need a multi-IO Board or an i2c-to-ADC multiplexer chip like the PCF8591 for interfacing:
http://www.mindstormsforum.de/viewtopic ... 268#p68268
Notice that for HATs perhaps no C/C++ drivers exist.


HTH!
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

User avatar
mwilliams03
Posts: 126
Joined: Mon Oct 29, 2012 2:56 pm
Contact: Website

Re: Sensors with C++ sensor library?

Tue May 03, 2016 5:44 am

You may find this interesting
https://github.com/mwilliams03/BerryIMU
C and python code for the BerryIMU (accelerometer, gyroscope, magnetometer, Barometric Pressure, Temperature) via i2c
Mark -- OzzMaker.com -- Creator of;
+ BerryIMU
+ Berry GPS-IMU
+BerryGPS-GSM
+ PiScreen - A 3.5" TFT for the Rasspberry Pi

MikeDK
Posts: 86
Joined: Thu Mar 19, 2015 12:01 pm

Re: Sensors with C++ sensor library?

Wed May 25, 2016 9:18 am

For temperature measurement I use the HTU21D ... it is a combined temperature/humidity sensor with I2C interface...:

Sparkfun HTU21D breakout board

It has the advantage that there is a hwmon kernel driver for it ... so the measurements are available via the sysfs interface, and also via lm-sensors

There is also the Microchip MCP9808 (also I2C)... this has no kernel driver, but a c driver and python bindings are existing here:
https://github.com/lexruee/mcp9808

You might also give the DS1820 a try, which is a OneWire temperature sensor - kernel driver is existing.


For GPS I can also recommend the NEO-6M ... I once got this working on a Pi with the gps daemon (gpsd) which is a really nice piece of software... instructions are here:
https://bigdanzblog.wordpress.com/2015/ ... pberry-pi/


regards,
MikeDK

Return to “C/C++”