MikroElektronika PIC Microcontrollers PIC16 Ficha de datos Pagina 55

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 194
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 54
Programming PIC Microcontrollers in BASIC - mikroElektronika
Prototype
sub procedure Dec2Bcd(dim dec_num as byte) as byte
Description Function converts 8-bit decimal numeral to BCD and returns the result as byte.
Example
dim a as byte
dim b as byte
...
a = 224
b = Dec2Bcd(a) ' b equals 140 now
5.2.1.7 Bcd2Dec – Converts 16-bit BCD value to decimal
Prototype
sub procedure Bcd2Dec16(dim bcd_num as word) as word
Description Function converts 16-bit BCD numeral to its decimal equivalent and returns the result as byte.
Example
dim a as word
dim b as word
...
a = 1234
b = Bcd2Dec16(a) ' b equals 4660 now
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/05.htm (13 sur 112)05/11/2004 02:20:52
Vista de pagina 54
1 2 ... 50 51 52 53 54 55 56 57 58 59 60 ... 193 194

Comentarios a estos manuales

Sin comentarios