User manual
724
mikoC PRO for dsPIC
MikroElektronika
Dec2Bcd
Prototype
unsigned short Dec2Bcd(unsigned short decnum);
Description Converts input unsigned short integer number to its appropriate BCD representation.
Parameters
- decnum: unsigned short integer number to be converted
Returns Converted BCD value.
Requires Nothing.
Example
unsigned short a, b;
...
a = 22;
b = Dec2Bcd(a); // b equals 34
Notes None.
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.