I have an RFID reader hooked up to a Arduino and one that goes to a PC. The PC one has options to output in different formats. I have this code for my Arduino:
// interrupt that happens when INTO goes low (0 bit)
void ISR_INT0() {
//Serial.print("0"); // uncomment this line to display raw binary
bitCount++;
flagDone = 0;
weigand_counter = WEIGAND_WAIT_TIME;
}
// interrupt that happens when INT1 goes low (1 bit)
void ISR_INT1() {
//Serial.print("1"); // uncomment this line to display raw binary
databits[bitCount] = 1;
bitCount++;
flagDone = 0;
weigand_counter = WEIGAND_WAIT_TIME;
}
if (bitCount == 26) {
for (i=1; i<25; i++) {
cardCode <<=1;
cardCode |= databits[i];
}
printBits();
}
So this reads in binary and converts it to base 10
According to the PC reader, this is "8 no. in D(last 3bytes)", I want to convert my numbers to "10 no. in D(four byte)”, is this possible? Some examples:
Binary: 001001011010111111101011 Actual reading: 2469867 Wanted Reading: 0270905323
Binary: 001001011010000101101010 Actual reading: 2466154 Wanted reading: 0270901610