craigsacco / raspberry_pi_projects Goto Github PK
View Code? Open in Web Editor NEWRandom set of projects and drivers that interact with Raspberry Pi hardware using Python
Random set of projects and drivers that interact with Raspberry Pi hardware using Python
Hi @craigsacco
I tried to test your MAX127 driver from my Raspberry connected with I2C protocol to my max127 DAS.
But it seems that there are some mistakes in the MAX127 class code, precisely in the function "get_data" :
def get_data(self):
value = 0
if self._bipolar:
value = (self._device.readRawS16BE() >> 4)
else:
value = (self._device.readRawU16BE() >> 4)
voltage = (value * MAX127.ADC_REFERENCE) /
(MAX127.ADC_MAX_VALUE >> (1 if self._bipolar else 0))
if self._range:
voltage = (voltage * 2.0)
return { "value": value, "voltage": voltage,
"channel": self._channel, "range": self._range,
"bipolar": self._bipolar }
Indeed, "readRawS16BE" and "readRawU16BE" functions imported from I2C.py ("Adafruit_GPIO" folder) don't exist. I believe you thought about using "readS16BE" and "readU16BE" functions still from I2C.py ?
Other question : were the max127 drivers tests successfull ? I didn't succeeded in getting value from a potentiometer (used to mesure a rotor position) with my MAX127 (voltage return by the function "get_data" of the MAX127 driver is always 5.0 volts even when I change the position of the rotor).
Last question : I think I'm wrong when precising "channel" value : I use int numbers (0 or 1) to cennect to channels 0 and 1 of the max127, is this correct ?
Thank you for your answers.
Hi @craigsacco,
I like your clean implementation of the Drivers and I would like to reuse some of them.
Would you mind licensing this under some permissive open source license?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.