-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: potential infinite loop - add timeout handling #78
Conversation
Thanks for this PR, |
OK, think the latter is quite optimal so I will merge and fix and bump the version number. |
Hello, I would like to point out that from this version 0.4.5, reading ports A0,...A3 no longer works by doing a simple ".readADC(x) |
Can you please open an issue for this as .readADC(pin) just should work. |
This is my code : (After many tests, I found that it doesn't work after the 0.3.9 version. // test lecture ADS1115 (I2C) SUR ESP32
// BROCHAGE :
// pin 21 ==> SDA ADS1115 (I2C)
// pin 22 ==> SCL ADS1115 (I2C)
#include "ADS1X15.h" // lib from Rob Tillaart ADS1X15 v 0.3.9 (incluse dans le dossier)
ADS1115 ADS(0x48); // instance for the ADS1115
int16_t valA0 = 0; // valeur brute lue sur A0 (15 bits)
int16_t valA1 = 0; // valeur brute lue sur A1 (15 bits)
int16_t valA2 = 0; // valeur brute lue sur A2 (15 bits)
int16_t valA3 = 0; // valeur brute lue sur 32 (15 bits)
int16_t difA2A3 = 0; // valeur brute lue sur différence A2 - A3 (15 bits)
void setup() {
Serial.begin(115200);
ADS.begin(); // démarrage ASD1115
ADS.setDataRate(7); // Taux de conversion rapide
ADS.setMode(1); // mesures à la demande
ADS.readADC(0); // lecture vide pour prise en compte des paramètres
ADS.setGain(0); // plage de lecture 0 à 6v.
}
void loop() {
valA0 = ADS.readADC(0); // lecture valeur brute A0 en 15 bits
delay(100);
valA1 = ADS.readADC(1); // lecture valeur brute A1 en 15 bits
delay(100);
valA2 = ADS.readADC(2); // lecture valeur brute A2 en 15 bits
delay(100);
valA3 = ADS.readADC(3); // lecture valeur brute A3 en 15 bits
delay(100);
difA2A3 = abs(ADS.readADC_Differential_2_3()); // différentiel de tension entre A2 et A3
Serial.print(valA0);
Serial.print(" ");
Serial.print(valA1);
Serial.print(" ");
Serial.print(valA2);
Serial.print(" ");
Serial.print(valA3);
Serial.print(" ");
Serial.println(difA2A3);
delay(500);
} (updated code tags for syntax highlighting) |
Did a quick test with ADS_read.ino, connected one channel to GND and left other three lines floating . Please open an issue and provide a minimal sketch that shows the problem.
|
Please open a new issue. |
I don't know how to open a new issue on GitHub... i'm sorry |
No description provided.