Datasheet
Programming PIC Microcontrollers in BASIC - mikroElektronika
5.2.1.8 Bcd2Dec – Converts 16-bit BCD value to decimal
Prototype
sub procedure Dec2Bcd16(dim dec_num as word) as word
Description Function converts 16-bit decimal numeral to BCD and returns the result as word.
Example
dim a as word
dim b as word
...
a = 4660
b = Dec2Bcd16(a) ' b equals 1234 now
5.2.2 ADC Library
ADC (Analog to Digital Converter) module is available with a number of PIC MCU models. Library function ADC_Read is
included to provide you comfortable work with the module. The function is currently unsupported by the following PIC MCU
models: P18F2331, P18F2431, P18F4331, and P18F4431.
5.2.2.1 ADC_Read – Get the results of AD conversion
Prototype
sub function ADC_Read(dim Channel as byte) as word
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/05.htm (14 sur 112)05/11/2004 02:20:52