ADXL377 Startup

Post test messages here

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Fore_2016
 
Posts: 26
Joined: Tue Jan 05, 2016 2:46 pm

ADXL377 Startup

Post by Fore_2016 »

We have some basic questions on the ADXL377/Arduino Startup:
1) We should run the calibration sketch first, correct?
2) Do we then download the main 377 sketch to then get it operations?
3) Once we compile that, how do we get it in run mode; ie, run it repeatedly as we move our object around (car) with the accelerator attached to it?

Team FTM

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: ADXL377 Startup

Post by adafruit_support_bill »

The ADXL377 is an analog accelerometer. You connect each axis output to an analog pin and call analogRead() to read the raw value.

When run according to the instructions, the calibration sketch will give you the raw readings corresponding to 1G in each of the 3 axis.
https://learn.adafruit.com/adafruit-ana ... ion-sketch

This data can be used as a basis for a 2-point calibration in your code: https://learn.adafruit.com/calibrating- ... alibration

User avatar
Fore_2016
 
Posts: 26
Joined: Tue Jan 05, 2016 2:46 pm

Re: ADXL377 Startup

Post by Fore_2016 »

Thanks. Yes, we understand it is an analog accelerator.

To that end, once, we paste in the sketch for calibration, compile, then we are good to go, correct?

By the way, when we copy the calibration sketch in, and compile; we get numerous errors such as: error: expected declaration before '}'token.

Any suggestions on how to resolve this?

Also, when you refer to 'instructions for the ADXL 377, what instruction document are you referring to'.

Thank you.

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: ADXL377 Startup

Post by adafruit_support_bill »

To that end, once, we paste in the sketch for calibration, compile, then we are good to go, correct?
You should be good to go for generating calibration data. Not sure what your application requirements are, but I'd expect you will need to write some additional code for that.
By the way, when we copy the calibration sketch in, and compile; we get numerous errors such as: error: expected declaration before '}'token
I just tried it and it compiles without error here. Be sure to use the copy button in the upper right corner of the code window to make sure you get a complete copy of the code.
Also, when you refer to 'instructions for the ADXL 377, what instruction document are you referring to'.
The instructuions for running the calibration sketch:
https://learn.adafruit.com/adafruit-ana ... ion-sketch

User avatar
Fore_2016
 
Posts: 26
Joined: Tue Jan 05, 2016 2:46 pm

Re: ADXL377 Startup

Post by Fore_2016 »

Thank you, good info.

After the calibration, we wish to mount to a Lacrosse helmet, that is mounted to a test stand, and move the test stand with a computer. Is there any existing code that we can use for that. We will inflict 2-50 gs on the Lacrosse helmet. Thank you.

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: ADXL377 Startup

Post by adafruit_support_bill »

What kind of data are you looking to collect? If you simply want to capture the peak acceleration forces, that would be a relatively simple modification of the calibration sketch. If you want to log the data over time, you will need either an SD card interface, or a serial interface back to a computer to collect the data.

User avatar
Fore_2016
 
Posts: 26
Joined: Tue Jan 05, 2016 2:46 pm

Re: ADXL377 Startup

Post by Fore_2016 »

Thanks Bill.

We wish to collect the peak acceleration.

Later, we will need to do it over time.

What modifications would be needed to the cal sketch?

Regards.

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: ADXL377 Startup

Post by adafruit_support_bill »

The calibration sketch only selects the min and max readings from the data when the button is pressed:

Code: Select all

  if (digitalRead(buttonPin) == LOW)
  {
    AutoCalibrate(xRaw, yRaw, zRaw);
  }
If you remove the 'if' statement and just call AutoCalibrate, it will monitor the data continuously for min and max readings.

User avatar
Fore_2016
 
Posts: 26
Joined: Tue Jan 05, 2016 2:46 pm

Re: ADXL377 Startup

Post by Fore_2016 »

Thank you very much. We will try that.

Locked
Please be positive and constructive with your questions and comments.

Return to “Test Message Forum (closed)”