Go to Post I believe it is in the spirit of the game is to score more points than your opponent within the rules. That means offense AND defense. - Gary Dillard [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 12-02-2012, 08:37
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
Re: Using a Gyro on any port (How to code that)?

If you only need low performance from the third gyro you could try integrating the output yourself. Allocate a regular AnalogChannel, poll it regularly, and add the values up.
Code:
pseudocode:
thisSample = gyroAnalog.getValue
thisTimeStamp = Timer.getTimestamp
thisAmountTurned = ((thisSample + lastSample)/2) * (thisTimestamp - lastTimestamp) * (Kgyro)
currentHeading += thisAmountTurned
lastSample = thisSample
lastTimeStamp = thisTimeStamp
lather, rinse, repeat
I doubt you will get performance anywhere near the FPGA, but it is pretty quick to try.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:48.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi