cTn
Posts: 49
Joined: Sat Aug 11, 2012 4:11 pm
Contact: Website

I2C Sensor in python - PyComms library

Tue Oct 09, 2012 5:14 pm

github repo: https://github.com/cTn-dev/PyComms

Hi guys, i hope this doesn't get marked as duplicate (because i also posted this in the Python section, but as this is mostly about sensors and robotics i thought i should also post it over here.

I was recently asked (by multiple people) for sensor source codes that i am currently using in my quadcopter project, i have some "initial" but 100% pure python support for
MPU6050 (with 6 axis DMP)
PCA9685 pwm/servo driver from adafruit (no real work there, just slightly modified code from adafruit guys)
HMC5883L (raw magnetometer data output)
i am planning to add support for BMP085 barometric sensor

I also created simple example file for each i2c device.

There is plenty of really well written i2c libraries for arduino, but basically none of those "exists" for python and as people use RPi to do various things, they require same level of sensor support that people have on arduino, so this is my first "crack" on getting some of the sensors that people use on arduinos to work on RPi (for those who use python of course), my libraries are still little rough around the edges, but they should give you a nice starting point for your project (because lets face it, not everyone has the skills or time to rewrite an 3000 long c++ library, am i right?)

I really hope that some of the skilled programmers can pitch in and make this library even better.
I am trying to get at least few of the libraries "under one roof", like i2cdevlib does, where people can download finished and fully working library for their respective sensor.

I really hope that at least a few individuals rise up and help make this a reality.

Well that's pretty much it, let the coding begin !

Good luck with your project and have a nice day.

hedge2211
Posts: 1
Joined: Sun Apr 07, 2013 7:20 pm

Re: I2C Sensor in python - PyComms library

Sun Apr 07, 2013 7:36 pm

This is great has saved me weeks of trying to convert my python code to work with the c++ versions, just had to change the device number and it worked perfectly for the my MPU6050.

trouch
Posts: 310
Joined: Fri Aug 03, 2012 7:24 pm
Location: France
Contact: Website

Re: I2C Sensor in python - PyComms library

Mon Apr 08, 2013 8:42 am

WebIOPi also provide an important devices driver library compatible with both Python 2 and Python 3 you can use in your scripts.
My library does not use smbus and provide a consistent API : https://code.google.com/p/webiopi/wiki/DEVICES

WebIOPi - Raspberry Pi REST Framework to control your Pi from the web
http://store.raspberrypi.com/projects/webiopi
http://code.google.com/p/webiopi/
http://trouch.com

cTn
Posts: 49
Joined: Sat Aug 11, 2012 4:11 pm
Contact: Website

Re: I2C Sensor in python - PyComms library

Mon Apr 08, 2013 8:46 am

trouch wrote:WebIOPi also provide an important devices driver library compatible with both Python 2 and Python 3 you can use in your scripts.
My library does not use smbus and provide a consistent API : https://code.google.com/p/webiopi/wiki/DEVICES
thats a nice stuff you have there, good job !

Return to “Automation, sensing and robotics”