/******************************************************************************* Kandó Kálmán Villamosmérnöki Szakkollégium Alapprojekt *******************************************************************************/ /*** INCLUDE FILES ************************************************************/ /*** SYMBOLIC CONSTANTS *******************************************************/ // Arduino Serial Interfaces #define debugSerial SerialUSB // Serial interface used for debugging // SODAQ ExpLoRer Board Arduino Pin Definitions // LED_BUILTIN D13 // LED_RED D16 // LED_GREEN D17 // LED_BLUE D18 // BLUETOOTH_WAKE D19 // LORA_RESET D45 // BT_RESET D46 // BUTTON D47 // TEMP_SENSOR A6 /*** GLOBAL VARIABLES & TYPE DEFINITIONS **************************************/ unsigned long currentMillis, previousMillis; // variables used to implement blink interval const long interval = 250; // interval (in mS) at which to toggle LED_BUILTIN int ledState = LOW; // used to set the LED value /*** LOCAL FUNCTION PROTOTYPES ************************************************/ /*** SETUP FUNCTION ***********************************************************/ void setup() { while (!debugSerial); // wait for a serial terminal application to connect to the board debugSerial.begin(115200); // initialize the debug serial port debugSerial.println("Microchip Technology ExpLoRer Starter Kit"); // start-up messages debugSerial.println("2019 LoRa Tanfolyam"); debugSerial.println("Kando Kalman Szakkollegium"); debugSerial.println("Alapprojekt\n"); pinMode(LED_BUILTIN, OUTPUT); // initialize digital pin LED_BUILTIN as an output. } // setup() /*** LOOP FUNCTION ************************************************************/ void loop() { currentMillis = millis(); // get the current time if (currentMillis - previousMillis >= interval) { // is it time to blink the LED? previousMillis = currentMillis; // yes - save the last time we blinked the LED if (ledState == LOW) { // toggle the LED state ledState = HIGH; } else { ledState = LOW; } digitalWrite(LED_BUILTIN, ledState); // apply the new LED state } } // loop() /*** LOCAL FUNCTION DEFINITIONS ***********************************************/