Browse Source

Fix mask to send to the F330 in the DUAL

fastled
Xose Pérez 7 years ago
parent
commit
cbdcf9f0f7
1 changed files with 4 additions and 5 deletions
  1. +4
    -5
      code/espurna/relay.ino

+ 4
- 5
code/espurna/relay.ino View File

@ -65,13 +65,12 @@ void _relayProviderStatus(unsigned char id, bool status) {
#if RELAY_PROVIDER == RELAY_PROVIDER_DUAL
// Calculate mask
unsigned char mask = 0;
for (unsigned char i=_relays.size()-1; i>=0; i-- ) {
mask <<= 1;
if (_relays[i].current_status) mask++;
unsigned char mask=0;
for (unsigned char i=0; i<_relays.size(); i++) {
if (_relays[i].current_status) mask = mask + (1 << i);
}
// Send it to EFM88
// Send it to F330
Serial.flush();
Serial.write(0xA0);
Serial.write(0x04);


Loading…
Cancel
Save