robert-hh / ads1x15 Goto Github PK
View Code? Open in Web Editor NEWMicropython driver for ADS1115 and ADS1015
Micropython driver for ADS1115 and ADS1015
Hello,
for the ads1015 i have a problem with your driver. I had to delete the gain on this
ads = ads1x15.ADS1015(i2c, addr)
by adding the gain i have this issue
function takes 4 positional arguments but 5 were given
Hi Robert, I'm using your library with a Pycom Wipy 3.0 in order to catch data from 3 sensors.
Sensor1 must be read every 10ms, sensor2 and sensor3 every 100ms.
I'm using 4 as a rate (_DR_1600SPS, # 1600/128 samples per second) and the conversion time is more or less 10ms. When i reach 100ms I got a delay since every conversion time is accumulated for the 3 sensors. In fact, sensor1 is sampled every 11ms, but at the tenth sampling it loses 30ms. Sensor2 and 3 are sampled every 130ms. Could you suggest me a way to reduce this delay?
Thank you!
Hi Robert, I'm trying to use this library for the 2-Channel 4-20 mA Current Loop Receiver 16-Bit ADS1115 I2C Mini Module with a Lopy, but I do not know if it's works. can you give some guidance to use it.
This is the module:
https://store.ncd.io/product/2-channel-4-20-ma-current-loop-receiver-16-bit-ads1115-i2c-mini-module/
I am testing your sample code for continuous sampling trigger by the ADC, however, there are a couple of things that are not clear. One of them is the irq
attribute of Pin
. Is the line
irq_pin.irq(trigger=Pin.IRQ_FALLING, handler=sample_auto)
supposed to work on ESP32 (i.e. LoPy4 + pysense)? In my case, it does not:
AttributeError: 'Pin' object has no attribute 'irq'
That said, I modified a few lines to instantiate the I2C
bus, and I can manage to run your example using the callback
method in Pin
. However, it does not seem to actually change the data rate of the ADC (I get around 34 sps, no matter the rate -- though I am executing this in REPL). You mentioned you reach 252 sps? Were you able to test different rates?
Help appreciated.
Hi here is the function I used for sampling at 860s/s.
i2c = I2C(1,scl=Pin(15), sda=Pin(14), freq=400000) ads = ads1x15.ADS1115(i2c, addr, gain) def sample(adc = ads.read_rev, data=data, timestamp = timestamp, voltage=ads.raw_to_v): global index_put, irq_busy for i in range(860): if irq_busy: return irq_busy = True if index_put < _BUFFERSIZE: ads.set_conv(7, 0) data[index_put] = ads.read_rev() index_put += 1 i +=1 irq_busy = False irq_busy = False index_put = 0
Here is what I get with a 40Hz Sine:
I don't know if it is my ADC or a problem in my code!
Any response is greatly appriciated :)
data = array("h", 0 for _ in range(_BUFFERSIZE)) <-error " generator has to be placed in parentheses if not the only argument."
data = array("h", (0 for _ in range(_BUFFERSIZE))) <- accepted
The 'machine' module was installed but is not detected. (sudo) pip install machine.
Installation process normal and concludes correctly, still, a "No module named machine" occurs.
Running Python 2.7 on Raspberri Pi Raspbian Stretch (Debian), current verison.
I leave the module file, 'ads1x15.py' in the same directory as the test script taken from github.
Should I have made some other preparation for using the module?
Hello, I'm trying to implement an transimpedance amplifier in a sensor circuit and the ADC I'll use is the ADS1114. By reading the registers page in the datasheet and by going through the hole python library, I don't know if this library may be compatible with this specific ADC. Could it be compatible or should I create a new library only for that ADC?
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.