Activity › Forums › Questions & Troubleshooting › Software & Firmware › Sampling rate for analog input of maxi automation
-
Sampling rate for analog input of maxi automation
-
Hi, I would like to ask what is the maximum sampling rate of controllino maxi automation for its analog input channel
best regards
Ramhuzaini
-
Hi,
based on my simple test – just calling analogRead in a loop, you can reach something like 8 kHz.
Code:void loop() {
// print the results to the Serial Monitor:
Serial.print(“Millis before:”);
Serial.println(millis());for (int i = 0; i < 1000; i++)
{
// read the analog in value:
sensorValue = analogRead(analogInPin);
}// print the results to the Serial Monitor:
Serial.print("Millis after:");
Serial.println(millis());}
If you need to be faster, you have to write your own solution to control the Analog to Digital Converter – please see the
ATmega2560 datasheet for more details. ATmega2560 is running at 16 MHz in the CONTROLLINO MAXI Automation.Best regards,
Lukas
Log in to reply.