       settings.r1 = value;
     } 
     else if (cmd == 'B') {
-        settings.r2 = value;
+      settings.r2 = value;
     } 
     else if (cmd == 'C') {
-        settings.offset = value;
+      settings.offset = value;
     } 
     else if (cmd == 'D') {
-        settings.sensitivity = value;
-    } 
+      settings.sensitivity = value;
+    }
     else if (cmd == 'S') {
-      if (value >= 0) {
+      if (value > 0) {
         digitalWrite(RELAY_PIN, HIGH);
       } 
       else {


void setup() {
  // Set serial port
  Serial.begin(115200);   
  // Default on
  pinMode(RELAY_PIN,OUTPUT);
  digitalWrite(RELAY_PIN, LOW);

#include <avr/eeprom.h>

// comment/uncomment to disable/enable debug
//#define DEBUG

// comment/uncomment to disable/enable ethernet support
#define NOETH

#define RELAY_PIN 2

#ifdef DEBUG
#define DBG if(1) 
