User manual

Table Of Contents
640
mikoC PRO for PIC32
MikroElektronika
Bcd2Dec
Prototype
unsigned short Bcd2Dec(unsigned short bcdnum);
Description Converts 8-bit BCD numeral to its decimal equivalent.
Parameters - bcdnum: 8-bit BCD numeral to be converted
Returns Converted decimal value.
Requires Nothing.
Example
unsigned short a, b;
...
a = 34;
b = Bcd2Dec(22); // b equals 22
Notes None.
Dec2Bcd16
Prototype
unsigned Dec2Bcd16(unsigned decnum);
Description Converts unsigned 16-bit decimal value to its BCD equivalent.
Parameters - decnum unsigned 16-bit decimal number to be converted
Returns Converted BCD value.
Requires Nothing.
Example
unsigned a, b;
...
a = 2345;
b = Dec2Bcd16(a); // b equals 9029
Notes None.
Bcd2Dec16
Prototype
unsigned Bcd2Dec16(unsigned bcdnum);
Description Converts 16-bit BCD numeral to its decimal equivalent.
Parameters - bcdnum 16-bit BCD numeral to be converted
Returns Converted decimal value.
Requires Nothing.
Example
unsigned a, b;
...
a = 0x1234; // a equals 4660
b = Bcd2Dec16(a); // b equals 1234
Notes None.