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