View Single Post
  #4   Spotlight this post!  
Unread 30-01-2013, 21:47
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Programming acc/gyro

Quote:
Originally Posted by TimBower View Post
Here is a follow-up question.

The WPI accelerometer icons found in LabVIEW under the WPI library is for an analog accelerometer (example under analog section of FRC examples). Is that using the gyroscope used as an accelerometer? If so, how is it wired?
The Kit of Parts came with an analog-output accelerometer for a couple of years. That's what those functions support.

Quote:
The A..345 accelerometer is a digital device. The example for the A..345 worked for me, but I'm not clear about how to bring the driver code for that into the project.
I can't find the instructions for integrating the I2C Accelerometer example, but here's how I did it:
  • Open the ADXL345 I2C Accelerometer.lvproj example.
  • Expand the RT CompactRIO Target subtree.
  • Right-click the ADXL345 I2C Accelerometer.vi and choose Save As... from the menu.
  • Select Duplicate hierarchy to new location and click the Continue... button.
  • Navigate to the folder containing your robot project and click the Current Folder button.
  • Open your robot project (you can close the example first if you want to).
  • Right-click RT CompactRIO Target and choose Add >> Folder (snapshot)...
  • Select the ADXL345 I2C Accelerometer Folder and click the Current Folder button.

Now you can copy the functions you want to use from the newly added ADXL345 I2C Accelerometer.vi into Begin, Teleop, Periodic Tasks, Finish, etc. Once you've placed them where you want them, you should remove ADXL345 I2C Accelerometer.vi from your project by right-clicking it and choosing Remove from Project.

You can also drag a vi from the Drivers folder into any vi you want to use it in, or use the Select a VI... option from the functions menu to find and place them.
Reply With Quote