![]() I searched for any library if available, but now I found the way to do this, asįirst divide by dec10, put modulus in the least BCD byte, thenĭivide the result by dec10, put the modulus in byte 1 of BCD, thenĪgain divide the result by dec10, put the modulus in byte 2 of BCD, thenĪgain divide the result by dec10, put the modulus in byte 3 of BCD that's all the logic. ![]() As hex it needed only 14 bits to hold value. Here i don't want to use it.īCD is 0 to 9 digit only having 4 bits.Hex value 0x3E8 = dec1000, in BCd, it need to have 4 nibbles to hold the value, ie 0x01, 0x0, 0x0, 0x0, or 4 bytes it self. ![]() That's only a code to drive the segment LED Hardware. I need normal string only not 7 segment code, as it is only use full and needed normally in Micro controller coding. This binary/Hex value of 14 bits length, should be converted to Human readable form as string to be displayed in Label and also in button texts( 12 buttons are there for displaying, why button - there I use button press to copy this string to dial screen from there I can dial out to do other function to Pic Micro itself. Octet values may contain filler digits if the number of BCD digits is odd. I am getting Data from Pic Micro controller to Android App via Blue tooth Module, The Data is having 30 Bytes, in that 24 bytes makes 12 ID's each with 16 bits integer(in PIC XC8 C Compiler), representing 1000 to 9999 in Decimal. This function converts a packed BCD value to a standard null-terminated string.
0 Comments
Leave a Reply. |