|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#12
|
|||
|
|||
|
Re: Value of degree to calculate range?
First to clarify: Math functions in the C library work with radians, not degrees.
Here is excerpt from MPLAB C18 libraries manual: tan Function: Compute the tangent. Include: math.h Prototype: float tan( float x ); Remarks: Computes the tangent of x (in radians). A domain error occurs if the argument is infinite or NaN. Both cases return NaN. Return Value: The tangent of x. File Name: tan.c Attached is spread sheet for calculating a look-up table. Copy and paste the data from the Range Text column to create your array. See rangelu.c for example of completed array. When you need to use the array declare as extern in that file. extern const rom unsigned short targetRange[]; If you use Kevin's changes to increase resolution on the tilt axis. The number of table entries will need to increase and the PWM TO DEGREES factor will need to be changed. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to calculate arm angles? | SoD | Programming | 5 | 31-01-2007 14:17 |
| White Paper Discuss: Spreedsheet to Calculate the Ranking of Teams | Joe Johnson | Extra Discussion | 27 | 29-03-2005 11:16 |
| How to calculate planetary gear ratios? | sanddrag | Technical Discussion | 2 | 27-02-2005 11:55 |
| How do you Calculate Belt Length? | Gabriel | Technical Discussion | 7 | 08-11-2004 14:54 |
| Microbiology Degree? | Jillian B. | Chit-Chat | 1 | 26-09-2003 20:19 |