Quote:
Originally Posted by Team3763 Adam
How do I incorporate this into our team's current code which features drive, camera, joystick, etc.?
|
In general, everything left of the loop in an example goes in Begin, and everything right of the loop goes in Finish. The contents of the loop (except for the delay) goes in Teleop, or wherever you need to read the value. Do not copy the Start/Stop Communication functions.
The Open function produces a Device Reference. You'll need a way to make it available in other VIs; that's what the RefNum Registry Set and Get functions are for. Follow the pattern you see with Joystick and Motor refnums in the code. The SPI Set/Get functions are in the WPI Robotics Library -> Communications subpalette.
Things will probably work best if you copy the contents of the
ADXL345 SPI Driver folder from the example project into your team's code, but I think you can get away with leaving them where they are as long as you don't make any changes to them.