Buonasera a tutti, sto ammattendo da un pò sull'argomento ed essendo alla fine di un progetto non mi va proprio di mollare.
Ho due sensori collegati in differenziale ad un ads1115, fin qui tutto ok.
Tramite il comando Serial.print formatto i dati ottenuti e li invio in seriale, poi tramite un serial datalogger li archivio in .txt.
Il punto è che, pur avendo il rate impostato a 9600, il datalogger non riceve i dati ad una frequenza superiore a 50hz, anche modificando il baud rate.
Come faccio a ricevere i dati ad almento 500hz, melgio se 1000 o 2000 o superiore ????
Vi allego il codice che ho scritto, ma vi prego non insultatemi:
#include <Wire.h>
#include <Adafruit_ADS1015.h>
Adafruit_ADS1015 ads1015; // Construct an ads1015 at the default address: 0x48
Adafruit_ADS1115 ads1115(0x49); // construct an ads1115 at address 0x49
Adafruit_ADS1115 ads; // Declare an instance of the ADS1115
#define ADS1015_REG_CONFIG_DR_3300SPS (0x00C0) // 3300 samples per second
int16_t rawADCvalueT; // The is where we store the value we receive from the ADS1115
int16_t rawADCvalueG; // The is where we store the value we receive from the ADS1115
void setup(void)
{
Serial.begin(9600);
ads.begin();
}
void loop(void)
{
rawADCvalueT = ads.readADC_Differential_0_1();
rawADCvalueG = ads.readADC_Differential_2_3();
Serial.print(rawADCvalueT);
Serial.print(" ");
Serial.println(rawADCvalueG);
delayMicroseconds(1);
}