Go to Post The goal isn't to keep the "bad" kids out. The goal is to take the "bad" out of kids, thereby transforming OUR culture. - Michael Corsetto [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
  #1   Spotlight this post!  
Unread 13-04-2015, 22:39
ArzaanK ArzaanK is offline
Registered User
FRC #1325 (Inverse Paradox)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Mississauga, Ontario, Canada
Posts: 40
ArzaanK is an unknown quantity at this point
Programming SPI Gyro

Hello Chief Delphi,
Our team recently ordered new gyros. We decided to go with the EVAL-ADXRS453Z boards. (http://www.analog.com/en/products/me...duct-overview).

The gyroscopes run on the SPI bus, and do not use an analog input like the KOP gyros. We have never programmed using SPI before, and we were hoping we could get some help. We have looked through the WPILib class documentation, and searched for examples, but we are having a hard time finding any. Also, it seems like there are no built in SPI examples this year in Eclipse.

We have written some base initialization code such as,
Code:
        SPI spiGyro = new SPI(Port.kOnboardCS0) ;
    	spiGyro.setClockRate(4000000);
    	spiGyro.setClockActiveHigh();
    	spiGyro.setChipSelectActiveLow();
    	spiGyro.setMSBFirst();
However, we do not know where to go from here. From the class documentation, it seems like we could have to use a combination of the read, write and transaction methods in order to receive data from the sensor.

If any of you have used SPI in the past, have example code we could look at, or just help us out, that would be greatly appreciated.
__________________
Arzaan Khairulla
Programmer/Driver
2013 Greater Toronto Regional East Winners with 1114 and 2056
2013 Galileo Division
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 12:33.

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