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
ADXL377 Startup
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88112
- Joined: Sat Feb 07, 2009 10:11 am
Re: ADXL377 Startup
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
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
- Fore_2016
- Posts: 26
- Joined: Tue Jan 05, 2016 2:46 pm
Re: ADXL377 Startup
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.
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.
- adafruit_support_bill
- Posts: 88112
- Joined: Sat Feb 07, 2009 10:11 am
Re: ADXL377 Startup
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.To that end, once, we paste in the sketch for calibration, compile, then we are good to go, correct?
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.By the way, when we copy the calibration sketch in, and compile; we get numerous errors such as: error: expected declaration before '}'token
The instructuions for running the calibration sketch:Also, when you refer to 'instructions for the ADXL 377, what instruction document are you referring to'.
https://learn.adafruit.com/adafruit-ana ... ion-sketch
- Fore_2016
- Posts: 26
- Joined: Tue Jan 05, 2016 2:46 pm
Re: ADXL377 Startup
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.
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.
- adafruit_support_bill
- Posts: 88112
- Joined: Sat Feb 07, 2009 10:11 am
Re: ADXL377 Startup
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.
- Fore_2016
- Posts: 26
- Joined: Tue Jan 05, 2016 2:46 pm
Re: ADXL377 Startup
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.
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.
- adafruit_support_bill
- Posts: 88112
- Joined: Sat Feb 07, 2009 10:11 am
Re: ADXL377 Startup
The calibration sketch only selects the min and max readings from the data when the button is pressed:
If you remove the 'if' statement and just call AutoCalibrate, it will monitor the data continuously for min and max readings.
Code: Select all
if (digitalRead(buttonPin) == LOW)
{
AutoCalibrate(xRaw, yRaw, zRaw);
}
- Fore_2016
- Posts: 26
- Joined: Tue Jan 05, 2016 2:46 pm
Re: ADXL377 Startup
Thank you very much. We will try that.
Please be positive and constructive with your questions and comments.