Skip to content

Commit

Permalink
Renames and cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
maniacbug committed Jun 12, 2012
1 parent c435724 commit d311cff
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions examples/sensornet/sensornet.pde
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ private:
public:
LED(int _pin): pin(_pin)
{
if (pin)
if (pin > 0)
{
pinMode(pin,OUTPUT);
digitalWrite(pin,LOW);
}
}
void write(bool state) const
{
if (pin)
if (pin > 0)
digitalWrite(pin,state?HIGH:LOW);
}
void operator=(bool state)
Expand All @@ -128,7 +128,7 @@ public:
* them in the same sequence.
*/

class Startup: public Timer
class StartupLEDs: public Timer
{
private:
const LED** leds;
Expand All @@ -152,7 +152,7 @@ protected:
}
}
public:
Startup(const LED** _leds, int _num): Timer(250), leds(_leds), current(_leds), end(_leds+_num), state(true)
StartupLEDs(const LED** _leds, int _num): Timer(250), leds(_leds), current(_leds), end(_leds+_num), state(true)
{
}
};
Expand Down Expand Up @@ -204,7 +204,7 @@ LED Red(led_red), Yellow(led_yellow), Green(led_green);

const LED* leds[] = { &Red, &Yellow, &Green };
const int num_leds = sizeof(leds)/sizeof(leds[0]);
Startup startup(leds,num_leds);
StartupLEDs startup_leds(leds,num_leds);
CalibrationLEDs calibration_leds(leds,num_leds);

// Nodes in test mode do not sleep, but instead constantly try to send
Expand Down Expand Up @@ -254,8 +254,8 @@ void setup(void)
#endif

// Prepare the startup sequence
startup.begin();
send_timer.begin();
startup_leds.begin();
calibration_leds.begin();

//
Expand Down Expand Up @@ -365,7 +365,7 @@ void loop(void)
{
// Pressing the button during startup sequences engages test mode.
// Pressing it after turns off test mode.
if ( startup )
if ( startup_leds )
test_mode = true;
else if ( test_mode )
{
Expand Down

0 comments on commit d311cff

Please sign in to comment.