|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#8
|
||||
|
||||
|
and here is the code to use the gyro as a compass heading. angle is a VAR WORD (16 bits) and it should be initialized to 32,000 or some other number in the middle of its range
'*************update auto_mode time counter and angle integration********************** auto_time=auto_time+delta_t+1 'increment loop counter, including any missed loops angle=angle+yaw-128 'add yaw sensor reading to angle integration angle1: if delta_t=0 then angle2 'add yaw againg for eact count of delta_t angle=angle+yaw-128 delta_t=delta_t-1 goto angle1 angle2: |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| gyro code | odin892 | Programming | 2 | 08-04-2003 14:50 |
| Team 469 and the Gyro | archiver | 2001 | 0 | 24-06-2002 02:57 |
| This Gyro is driving me crazy! | archiver | 2001 | 2 | 23-06-2002 23:35 |
| Is any team using the gyro chip? | Ragin_Kage | Kit & Additional Hardware | 4 | 10-04-2002 12:11 |
| Have YOU used the gyro chip? | FotoPlasma | Technical Discussion | 10 | 31-01-2002 13:26 |