This repository has been archived on 2020-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
arduino_universal_serial_ad.../Libraries/Metro/examples/serialInterval/serialInterval.pde

25 lines
646 B
Plaintext
Raw Normal View History

2013-04-08 16:45:22 +00:00
// This example sends a Serial message every 250 milliseconds
#include <Metro.h> // Include the Metro library
Metro serialMetro = Metro(250); // Instantiate an instance
void setup() {
Serial.begin(115200); // Start the Serial communication
}
void loop() {
if (serialMetro.check() == 1) { // check if the metro has passed it's interval .
// Output all the analog readings seperated by a space character
for (int i = 0; i < 6; i++ ) {
Serial.print (analogRead( i) );
Serial.print(32,BYTE);
}
// Terminate message with a linefeed and a carriage return
Serial.print(13,BYTE);
Serial.print(10,BYTE);
}
}