#include unsigned long previousMillis = 0; ALTAIR_M8S theM8S; void setup() { Serial.begin(38400); Serial.println(F("Starting M8S setup...")); if (!theM8S.initialize()) { Serial.println(F("M8S init failed")); while(1); } theM8S.cmdMode(); theM8S.sendCmd("STAT 1"); // "STAT" returns a statistics overview, // "STAT {1..4}" outputs different statistics from M8S // "STAT 9" resets statistics theM8S.cmdModeExit(); delay(100); Serial.println(F("M8S Setup complete")); } void loop() { unsigned long currentMillis = millis(); if (currentMillis - previousMillis > 5000) { previousMillis = currentMillis; theM8S.transmitTest(); } theM8S.readSerial(); // theM8S.lastRSSI(); }