Skip to content

Commit

Permalink
remove whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
robogrobo committed Nov 7, 2011
1 parent 1ee0138 commit fa54820
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions hager_impuls.pde
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ boolean ledOff = 1;
long prevMillis = 0;
boolean debug = 0;

void setup() {
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(sensorPin, INPUT);

Serial.begin(9600);
Serial.println("Serial ready");
}
Expand All @@ -36,38 +36,38 @@ void loop() {

digitalWrite(ledPin, HIGH);
ledOff = false;

if(debug) {
Serial.println(impuls, DEC);
}
} else if(sensorVal < threshold) {
digitalWrite(ledPin, LOW);
ledOff = true;
}

// script commands
if(Serial.available() > 0) {
char command = Serial.read();
switch(command) {
case 'S': // send total impuls count
Serial.print("echo ");
Serial.print(impuls);
Serial.println(" | nc barbados 4919");
break;
case 'R': // reset impuls count
impuls = 0;
break;
case 'D': // debug mode
debug = !debug;
break;
case 'H': // help
Serial.print("This is the hager ec352 impuls counter help.\nBasic commandos:\n");
Serial.print("S send impuls count to server\n");
Serial.print("R reset impuls count\n");
Serial.println("D toggle debug mode\n");
break;
default:
return;
case 'S': // send total impuls count
Serial.print("echo ");
Serial.print(impuls);
Serial.println(" | nc barbados 4919");
break;
case 'R': // reset impuls count
impuls = 0;
break;
case 'D': // debug mode
debug = !debug;
break;
case 'H': // help
Serial.print("This is the hager ec352 impuls counter help.\nBasic commandos:\n");
Serial.print("S send impuls count to server\n");
Serial.print("R reset impuls count\n");
Serial.println("D toggle debug mode\n");
break;
default:
return;
}
}
}

0 comments on commit fa54820

Please sign in to comment.