MySensors Library & Examples  2.3.2
ClearEepromConfig.ino
1 /*
2  * The MySensors Arduino library handles the wireless radio link and protocol
3  * between your home built sensors/actuators and HA controller of choice.
4  * The sensors forms a self healing radio network with optional repeaters. Each
5  * repeater and gateway builds a routing tables in EEPROM which keeps track of the
6  * network topology allowing messages to be routed to nodes.
7  *
8  * Created by Henrik Ekblad <[email protected]>
9  * Copyright (C) 2013-2019 Sensnology AB
10  * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
11  *
12  * Documentation: http://www.mysensors.org
13  * Support Forum: http://forum.mysensors.org
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * version 2 as published by the Free Software Foundation.
18  *
19  *******************************
20  *
21  * DESCRIPTION
22  *
23  * This sketch clears radioId, relayId and other routing information in EEPROM back to factory default
24  *
25  */
26 // load core modules only
27 #define MY_CORE_ONLY
28 
29 #include <MySensors.h>
30 
31 void setup()
32 {
33  Serial.begin(MY_BAUD_RATE);
34  Serial.println("Started clearing. Please wait...");
35  for (uint16_t i=0; i<EEPROM_LOCAL_CONFIG_ADDRESS; i++) {
36  hwWriteConfig(i,0xFF);
37  }
38  Serial.println("Clearing done.");
39 }
40 
41 void loop()
42 {
43  // Nothing to do here...
44 }
#define MY_BAUD_RATE
Serial output baud rate (debug prints and serial gateway speed).
Definition: MyConfig.h:163
API declaration for MySensors.
void begin(int baud)
This function does nothing.
void setup()
Called after node initialises but before main loop.
#define EEPROM_LOCAL_CONFIG_ADDRESS
First free address for sketch static configuration.
void loop()
Main loop.