Go to Post Hallry's back! Tell a Friend! - Tyler Olds [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-01-2013, 18:36
Team3763 Adam Team3763 Adam is offline
Lead Programmer
FRC #3763 (4H WildCards)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: North Carolina
Posts: 157
Team3763 Adam can only hope to improve
ADXL345 SPI Accelerometer

How do you set up the code for the ADXL345 SPI Accelerometer? I opened up the example under the example finder, but I don't know where to put the code or what I need for read, range, etc.
Reply With Quote
  #2   Spotlight this post!  
Unread 23-01-2013, 12:36
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: ADXL345 SPI Accelerometer

Quote:
Originally Posted by Team3763 Adam View Post
How do you set up the code for the ADXL345 SPI Accelerometer? I opened up the example under the example finder, but I don't know where to put the code or what I need for read, range, etc.
The example is all you need. You connect the sensor, as shown on the Front Panel, and you hit the Run button to watch it work.

You'll have to change the IP address on the Project Explorer to your team's IP address.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote
  #3   Spotlight this post!  
Unread 23-01-2013, 14:37
Team3763 Adam Team3763 Adam is offline
Lead Programmer
FRC #3763 (4H WildCards)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: North Carolina
Posts: 157
Team3763 Adam can only hope to improve
Re: ADXL345 SPI Accelerometer

How do I incorporate this into our team's current code which features drive, camera, joystick, etc.?
Reply With Quote
  #4   Spotlight this post!  
Unread 23-01-2013, 20:03
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,113
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: ADXL345 SPI Accelerometer

Quote:
Originally Posted by Team3763 Adam View Post
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.
Reply With Quote
  #5   Spotlight this post!  
Unread 29-01-2013, 12:58
Doug Norman's Avatar
Doug Norman Doug Norman is offline
Registered User
no team (National Instruments)
Team Role: Engineer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Austin, TX
Posts: 137
Doug Norman will become famous soon enoughDoug Norman will become famous soon enough
Re: ADXL345 SPI Accelerometer

You might also look at Tutorial 7 - Integrating Examples into Robot Code. You can find this on the Tutorials tab of the LabVIEW Getting Started Window. If you already have LabVIEW code open, choose View>>Getting Started Window...
__________________
Doug Norman
National Instruments
Reply With Quote
  #6   Spotlight this post!  
Unread 08-02-2013, 20:35
tcjinaz tcjinaz is offline
Tim
FRC #3853
Team Role: Mentor
 
Join Date: May 2011
Rookie Year: 2011
Location: Arizona
Posts: 206
tcjinaz has a spectacular aura abouttcjinaz has a spectacular aura about
Re: ADXL345 SPI Accelerometer

Now, how to debug why there's nothing. No errors, no change in data. From two of the three boards we have (haven't tried the third). Will I need to put a scope on the send and receive lines?
__________________
Software Mentor
3853 Pridetronics[

Reply With Quote
  #7   Spotlight this post!  
Unread 09-02-2013, 11:31
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: ADXL345 SPI Accelerometer

Quote:
Originally Posted by tcjinaz View Post
Now, how to debug why there's nothing. No errors, no change in data. From two of the three boards we have (haven't tried the third). Will I need to put a scope on the send and receive lines?
Have you updated LabVIEW recently? There was a bug with the SPI communication a few weeks back, and it was fixed with an update, then more recently, some other bugs were squashed wtih the latest update.

Specifically, there is were two updates for LabVIEW. Here's the latest updated.

Next, if you haven't, update the utilities and driver station as well. Those are available from the link above as well. To note, you MUST have the newest driver station software installed prior to competition.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote
Reply


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 21:46.

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