ads1x15 | Micropython driver for ADS1115 and ADS1015
kandi X-RAY | ads1x15 Summary
kandi X-RAY | ads1x15 Summary
Micropython driver for ADS1115 and ADS1015
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Read one or more channels
- Writes a register to the given register
- Read a register from memory
- Start alert
- Start conversion
- Return the revision of the register
- Read register
ads1x15 Key Features
ads1x15 Examples and Code Snippets
Community Discussions
Trending Discussions on ads1x15
QUESTION
I applied the following code (https://circuitpython.readthedocs.io/projects/ads1x15/en/latest/examples.html) to read voltage.
In the last line of python code, I have set time.sleep command as (1/3300 s)
I have following queries:
- In the time column, time-step comes out to be approximately (0.02 s). However expected time-step is (1/3300)s. Why does this occur?
- How do I ensure that the time-step i.e sampling frequency between two successive time data points remains exactly at 3300 Hz. ?
- How do I ensure that 1st time-data point starts with "0"?
Can somebody please clarify my doubts!
...ANSWER
Answered 2020-Dec-03 at 20:40The sampling rate of the ADS1015 is meant to be 3300S/sec only in continuous mode, and sampling one channel at a time. There are 2 steps here:
- Ensure your ADC is in continuous sampling mode. Putting it in continuous mode would be something like "adc.mode = 0", provided your library supports it. I have used this one https://github.com/adafruit/Adafruit_ADS1X15 and it does support it.
- Ensure that the Data rate in the config register is set to 3300. (page 16 on the datasheet at https://cdn-shop.adafruit.com/datasheets/ads1015.pdf)
Purely that would also mostly not be enough, getting to the full potential of the ADC would also need a compatible processor that can handle large amounts of data on its i2c bus. Something like a raspberry pi is mostly not powerful enough. Using faster languages like C/C++ would also help.
QUESTION
I have designed an application which have two buttons i.e CAL and SAV. Accordingly that I have two functions but the issue is sometimes production line Operator by mistake presses SAV button. So that attribute error arises and program stuck.
How to overcome this issue? Please guide me.
Here is my code:
...ANSWER
Answered 2020-Oct-27 at 13:21A brute force solution would be to check whether root has an L2 attribute or not
QUESTION
Started using node red to make a better interface than tkinter, all is going good but i am trying to now connect node red to show devices connected to my i2c bus, i am using the i2c scan node which shows 3 devices connected to my i2c bus at address 39,72,and 73, but my devices are connected to 27,48,and 49. i have ads1x15.ads1015 connected to 0x47 ads1x15.ads1015 connected to 0x48 gpio expander conneccted to 0x27
any ideas why i am seeing the wrong numbers on the ic2 scan in node red compared to i2cdect -y 1 in the terminal window on the rasberry pi4?
...ANSWER
Answered 2020-Aug-24 at 18:54The answers from the node are right, it's just that they are in base 10 not base 16
QUESTION
I recently started a project to make a data logging script for my Raspberry Pi. My goal is to make a program that can:
- Collect voltage data from the pH sensor that's hooked up to my Pi (that's the
getData()
function). - Plot it on the screen in real time.
- Continuously append them into a CSV file every few seconds.
I've included my code below for both the function that collects sensor data and the function that plots/saves them. Everything works as expected, except for some reason I can't see the new data added to the CSV file test2.csv
until I terminate the code with Ctrl+C (the IDE is Thonny).
While the code is running, the csv file is just blank, and not even the heading "Data and Time, P0, P1" is there, making me think that for some reason Python doesn't actually append new data into the file until the very end.
If I stopped the script using the red "Stop/Restart Backend" button from Thonny, no new data will be added to test2.csv
. New data will only be appended to test2.csv
if I run the script and stop it using Ctrl+C, which isn't helpful because I want to be able to access the existing data without stopping the program.
Any idea on how to fix this so that the CSV file will update without me terminating the script?
My function for collecting data:
...ANSWER
Answered 2020-Jun-09 at 21:48The answer is actually pretty simple and easily reproducible. Python does not write to files until you close the file that was opened.
Proof:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ads1x15
You can use ads1x15 like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page