|
|
@ -71,7 +71,7 @@ void sendNRF(){
|
|
|
|
datasend = (datasend << 1) + tallyLEDstat[i];
|
|
|
|
datasend = (datasend << 1) + tallyLEDstat[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
datasend = datasend << (8 - tallyLEDlength);
|
|
|
|
datasend = datasend << (8 - tallyLEDlength);
|
|
|
|
datasend = (datasend << 8) + getChecksum(datasend && 0xFF);
|
|
|
|
datasend = (datasend << 8) + getChecksum(datasend & 0xFF);
|
|
|
|
|
|
|
|
|
|
|
|
radio.writeFast(&datasend, sizeof(datasend));
|
|
|
|
radio.writeFast(&datasend, sizeof(datasend));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -90,6 +90,6 @@ boolean dataChanged(){
|
|
|
|
|
|
|
|
|
|
|
|
uint8_t getChecksum(uint8_t data){
|
|
|
|
uint8_t getChecksum(uint8_t data){
|
|
|
|
uint8_t checksum = 0;
|
|
|
|
uint8_t checksum = 0;
|
|
|
|
for (int i=8; i<8; i++) checksum += (data >> i) && 1;
|
|
|
|
for (int i=8; i<8; i++) checksum += (data >> i) & 1;
|
|
|
|
return checksum;
|
|
|
|
return checksum;
|
|
|
|
}
|
|
|
|
}
|
|
|
|