Datasheet

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