ABL electronic PIC16 Personal Computer User Manual


 
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
30 2
MikroElektronika:
Development
tools
-
Books
-
Compilers
page
Prototype
unsigned Dec2Bcd(unsigned decnum);
Returns Returns converted BCD value.
Description Converts 16-bit decimal value decnum to BCD.
Example
unsigned a;
...
a = Dec2Bcd16(4660);
// equals 1234
Dec2Bcd16
Prototype
unsigned Bcd2Dec16(unsigned bcdnum);
Returns Returns converted decimal value.
Description Converts 16-bit BCD numeral bcdnum to its decimal equivalent.
Example
unsigned a;
...
a = Bcd2Dec16(1234);
// equals 4660
Bcd2Dec16
Prototype
unsigned short Dec2Bcd(unsigned short decnum);
Returns Returns converted BCD value.
Description Converts 8-bit decimal value decnum to BCD.
Example
unsigned short a;
...
a = Dec2Bcd(52);
// equals 0x52
Dec2Bcd