<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Eprom erase Jumper]]></title><description><![CDATA[<p dir="auto">I´m not a programmer, only user - my wish would be to have an eprom-erase-jumper, so i don´t need to erase it when moving the sensor from one gateway to another one, even to another installation.<br />
I was even thinking, as there are many unused ports on the arduino, about jumpers to select the update time ?</p>
]]></description><link>https://forum.mysensors.org/topic/2512/eprom-erase-jumper</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 11:58:30 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/2512.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 04 Dec 2015 12:49:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Eprom erase Jumper on Sat, 05 Dec 2015 16:59:18 GMT]]></title><description><![CDATA[<p dir="auto">Thank BartE, exactly what i needed, works perfect<br />
I already upgraded all my sensors, makes it much easyer because i have a different gateway on my solder bench then in the house</p>
<p dir="auto">It would maybe make sense to include that feature to the examples ?</p>
<p dir="auto">Best regards</p>
<p dir="auto">Klaus</p>
]]></description><link>https://forum.mysensors.org/post/25807</link><guid isPermaLink="true">https://forum.mysensors.org/post/25807</guid><dc:creator><![CDATA[kr0815]]></dc:creator><pubDate>Sat, 05 Dec 2015 16:59:18 GMT</pubDate></item><item><title><![CDATA[Reply to Eprom erase Jumper on Fri, 04 Dec 2015 20:55:30 GMT]]></title><description><![CDATA[<p dir="auto">HI <a class="plugin-mentions-user plugin-mentions-a" href="/user/kr0815" aria-label="Profile: kr0815">@<bdi>kr0815</bdi></a> , what you can do is add a piece of code which checks for a jumper presence on start-up if so just erase your EEPROM.</p>
<p dir="auto">An input pin will become LOW when the jumper connects this pin to GND and will become HIGH when the jumper is removed (stable high by activating the interval pull up resistor)</p>
<p dir="auto">This jumper check code can be something like this:</p>
<pre><code>    pinMode(CLEAR_EEPROM_JUMPER, INPUT);           // set pin to input
    digitalWrite(CLEAR_EEPROM_JUMPER, HIGH);       // turn on internal pull up resistors
    delay(50);                                     // Wait to stabilize the input pin
    // If jumper is placed and thus the input pin is LOW a clean EEPROM is required
    if (digitalRead(CLEAR_EEPROM_JUMPER) == LOW) {
        Serial.begin(BAUD_RATE);
        Serial.println(F("Clearing EEPROM. Please wait..."));
        for (int i=0;i&lt;512;i++) {
            EEPROM.write(i, 0xff);
        }
        Serial.println(F("Clearing done. Continue with normal init..."));
    }
</code></pre>
<p dir="auto">A very simple plug in would look something like this:</p>
<pre><code>#include &lt;MySensor.h&gt;
#include &lt;SPI.h&gt;
#include &lt;EEPROM.h&gt;  

// Clear EEPROM jumper: when placed this pin should be connected to GND 
#define CLEAR_EEPROM_JUMPER  6

MySensor gw;

void setup()  
{ 
    pinMode(CLEAR_EEPROM_JUMPER, INPUT);           // set pin to input
    digitalWrite(CLEAR_EEPROM_JUMPER, HIGH);       // turn on internal pull up resistors
    delay(50);                                     // Wait to stabalize the input pin
    // If jumper is placed and thus the input pin is LOW a clean EEPROM is required
    if (digitalRead(CLEAR_EEPROM_JUMPER) == LOW) {
        Serial.begin(BAUD_RATE);
        Serial.println(F("Clearing EEPROM. Please wait..."));
        for (int i=0;i&lt;512;i++) {
            EEPROM.write(i, 0xff);
        }
        Serial.println(F("Clearing done. Continue with normal init..."));
    }
    
    // place normal init here
    gw.begin();
}

void loop()      
{ 
    // Normal sensor stuff here
    gw.process();
} 
</code></pre>
<p dir="auto">Just add this check to all your plugin code</p>
]]></description><link>https://forum.mysensors.org/post/25782</link><guid isPermaLink="true">https://forum.mysensors.org/post/25782</guid><dc:creator><![CDATA[BartE]]></dc:creator><pubDate>Fri, 04 Dec 2015 20:55:30 GMT</pubDate></item></channel></rss>