// The program samples a wawe form and send it to the serial port. // You can set the sampling frequency by introducing a delay T in // between each sample (take into account that analogRead() function // takes about 5 microsecond. // You can define the integration window by setting NSample int analogPin = A3; // tensione da misurare float FullScale = 3.3; // default reference value for arduino Due int data[1000]; // array to store the sampled counting int NSamples = 1000; // non superate le dimensioni del vettore data int T = 0; // in microsecondi; puo' essere usata per cambiare // la frequenza di acquisizione. // AnalogRead() impiega circa 5 microsecondi int i = 0; long unsigned t0, t1; // time float deltaT; // intervallo di tempo tra una lettura e l'altra (in us) void setup() { // put your setup code here, to run once: analogReference(AR_DEFAULT); // Arduino Due 3.3 V // analogReadResolution(12); // set the analog input resolution to 12 bit Serial.begin(9600); Serial.println(" Waveform Sampling "); Serial.println(" "); } void loop() { // start the loop to sample the waweform t0=micros(); for (i=0 ; i