Switched to the for loop and bit masking to check the bit value
This commit is contained in:
19
src/main.cpp
19
src/main.cpp
@@ -44,25 +44,16 @@ void sendBlast(void) {
|
||||
sendShort();
|
||||
_delay_ms(BIT_LENGTH);
|
||||
|
||||
//Start 32 bit Code
|
||||
for (int i=0; i<9;i++){
|
||||
for(int i=0; i<32; i++){
|
||||
if (code &0x80000000){
|
||||
sendShort();
|
||||
}
|
||||
for (int i=0;i<8;i++){
|
||||
else{
|
||||
sendLong();
|
||||
code<<=1;
|
||||
}
|
||||
for (int i=0;i<6;i++){
|
||||
sendShort();
|
||||
}
|
||||
for (int i=0;i<3;i++){
|
||||
sendShort();
|
||||
}
|
||||
for (int i=0;i<4;i++){
|
||||
sendLong();
|
||||
}
|
||||
for(int i=0;i<2;i++){
|
||||
sendShort();
|
||||
}
|
||||
|
||||
//stop bit
|
||||
sendShort();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user