Changed WITH_LEDS_BLINKING option to use the default LED pins as described on http://www.mysensors.org/build/advanced_gateway for consistency and backwards compatibility. Also corrected the LED on/off state to HIGH/LOW from LOW/HIGH respectively.
This commit is contained in:
@@ -58,11 +58,11 @@
|
|||||||
// default LEDs blinking period in milliseconds
|
// default LEDs blinking period in milliseconds
|
||||||
#define DEFAULT_LED_BLINK_PERIOD 300
|
#define DEFAULT_LED_BLINK_PERIOD 300
|
||||||
// The RX LED default pin
|
// The RX LED default pin
|
||||||
#define DEFAULT_RX_LED_PIN 8
|
#define DEFAULT_RX_LED_PIN 6
|
||||||
// The TX LED default pin
|
// The TX LED default pin
|
||||||
#define DEFAULT_TX_LED_PIN 9
|
#define DEFAULT_TX_LED_PIN 5
|
||||||
// The Error LED default pin
|
// The Error LED default pin
|
||||||
#define DEFAULT_ERR_LED_PIN 7
|
#define DEFAULT_ERR_LED_PIN 4
|
||||||
|
|
||||||
|
|
||||||
/**********************************
|
/**********************************
|
||||||
|
|||||||
@@ -110,33 +110,33 @@ void MySensor::handleLedsBlinking() {
|
|||||||
// do the actual blinking
|
// do the actual blinking
|
||||||
if(countRx && countRx != 255) {
|
if(countRx && countRx != 255) {
|
||||||
// switch led on
|
// switch led on
|
||||||
digitalWrite(pinRx, LOW);
|
digitalWrite(pinRx, HIGH);
|
||||||
}
|
}
|
||||||
else if(!countRx) {
|
else if(!countRx) {
|
||||||
// switching off
|
// switching off
|
||||||
digitalWrite(pinRx, HIGH);
|
digitalWrite(pinRx, LOW);
|
||||||
}
|
}
|
||||||
if(countRx != 255)
|
if(countRx != 255)
|
||||||
--countRx;
|
--countRx;
|
||||||
|
|
||||||
if(countTx && countTx != 255) {
|
if(countTx && countTx != 255) {
|
||||||
// switch led on
|
// switch led on
|
||||||
digitalWrite(pinTx, LOW);
|
digitalWrite(pinTx, HIGH);
|
||||||
}
|
}
|
||||||
else if(!countTx) {
|
else if(!countTx) {
|
||||||
// switching off
|
// switching off
|
||||||
digitalWrite(pinTx, HIGH);
|
digitalWrite(pinTx, LOW);
|
||||||
}
|
}
|
||||||
if(countTx != 255)
|
if(countTx != 255)
|
||||||
--countTx;
|
--countTx;
|
||||||
|
|
||||||
if(countErr && countErr != 255) {
|
if(countErr && countErr != 255) {
|
||||||
// switch led on
|
// switch led on
|
||||||
digitalWrite(pinEr, LOW);
|
digitalWrite(pinEr, HIGH);
|
||||||
}
|
}
|
||||||
else if(!countErr) {
|
else if(!countErr) {
|
||||||
// switching off
|
// switching off
|
||||||
digitalWrite(pinEr, HIGH);
|
digitalWrite(pinEr, LOW);
|
||||||
}
|
}
|
||||||
if(countErr != 255)
|
if(countErr != 255)
|
||||||
--countErr;
|
--countErr;
|
||||||
@@ -182,9 +182,9 @@ void MySensor::begin(void (*_msgCallback)(const MyMessage &), uint8_t _nodeId, b
|
|||||||
pinMode(pinEr, OUTPUT);
|
pinMode(pinEr, OUTPUT);
|
||||||
|
|
||||||
// Set initial state of leds
|
// Set initial state of leds
|
||||||
digitalWrite(pinRx, HIGH);
|
digitalWrite(pinRx, LOW);
|
||||||
digitalWrite(pinTx, HIGH);
|
digitalWrite(pinTx, LOW);
|
||||||
digitalWrite(pinEr, HIGH);
|
digitalWrite(pinEr, LOW);
|
||||||
|
|
||||||
// initialize counters
|
// initialize counters
|
||||||
countRx = 0;
|
countRx = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user