MikroElektronika PIC Microcontrollers PIC16 Ficha de datos Pagina 153

  • 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 152
Programming PIC Microcontrollers in BASIC - mikroElektronika
Prototype sub function cosE3(dim Angle as word) as integer
Description Function takes a word-type number which represents angle in degrees and returns the cosine of <Angle> as
integer, multiplied by 1000 (1E3) and rounded up to nearest integer: result = round_up(cos(Angle)
*1000). Thus, the range of the return values for these functions is from -1000 to 1000.
Note that parameter <Angle> cannot be negative. Function is implemented as lookup table, and the maximum
error obtained is ±1.
Example
dim angle as word
dim result as integer
angle = 90
result = cosE3(angle) ' result is 0
5.2.23 Utilities
BASIC provides a utility set of procedures and functions for faster development of your applications.
5.2.23.1 Button – Debounce
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/05.htm (111 sur 112)05/11/2004 02:20:55
Vista de pagina 152
1 2 ... 148 149 150 151 152 153 154 155 156 157 158 ... 193 194

Comentarios a estos manuales

Sin comentarios