mikroElektronika PIC Microcontrollers PIC12 User Manual page 310

Mikroc user's manual
Table of Contents

Advertisement

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

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents