Jump to content
Sign in to follow this  
Rei Vilo

[Energia Library] FraunchPad 3-Axis Accelerometer

Recommended Posts

Please find the library for the 3-axis accelerometer built on the FraunchPad MSP430FR5739 board:


This library uses integers only to save memory from the costly float.

The library also features an auto-calibration routine.

FraunchPad ADXL335 accelerometer
press PUSH1 to calibrate
press PUSH2 to exit serial
g: x y z deg: x y z
g: -0.03 -0.08 1.03 deg: -1.15 -4.05 90.00
g: -0.03 -0.08 1.03 deg: -1.15 -4.05 90.00
g: -0.03 -0.08 1.03 deg: -1.15 -4.05 90.00
calibrate... done
g: 0.01 0.00 1.00 deg: 0.57 0.00 90.00
g: 0.00 0.00 1.00 deg: 0.00 0.00 90.00
g: 0.00 0.00 1.00 deg: 0.00 0.00 90.00
g: 0.00 0.00 1.00 deg: 0.00 0.00 90.00
...
g: -0.68 -0.78 0.07 deg: -41.59 -49.05 3.47
g: -0.65 -0.78 0.13 deg: -39.42 -50.00 6.94
g: 0.07 -0.93 0.26 deg: 4.05 -74.10 15.68
g: 0.24 -0.77 0.54 deg: 13.89 -52.83 33.62
exit... end

Share this post


Link to post
Share on other sites

Thank you very much for the library! How do I import this to Energia? Make a folder under ../hardware/msp430/libraries and then copy these files into it?

 

 

  Accelerometer_FRAUNCHPAD.ino 4 months ago Example: Reading the Built-In FraunchPad Accelerometer [rei-vilo]   FraunchPad_Accelerometer.cpp 4 months ago Examples adapted to FranchPad [rei-vilo]   FraunchPad_Accelerometer.h 4 months ago

Example: Reading the Built-In FraunchPad Accelerometer [rei-vilo]

 

 

Thanks!

Share this post


Link to post
Share on other sites

Thank you got it working now!

 

Following the guide from your link, I made a new directory "FPAccel" under

 

C:\energia-0101E0009\hardware\msp430\libraries

 

To make it like

 

C:\energia-0101E0009\hardware\msp430\libraries\FPAccel

 

Then downloaded your source from github and put under it.

 

FraunchPad_Accelerometer.cpp<br />

FraunchPad_Accelerometer.h

 

Did the above while Energia is not running. Otherwise it might take a restart of Energia for the new library code to register.

 

Started a new sketch in Energia, and then pasted the <a href="https://github.com/energia/Energia/blob/master/examples/6.Sensors/Accelerometer_FRAUNCHPAD/Accelerometer_FRAUNCHPAD.ino" title="Accelerometer_FRAUNCHPAD.ino">Accelerometer_FRAUNCHPAD.ino</a> as source code.

 

Then selected "FraunchPad" under "Tools > Board" in Energia and viola! The terminal is showing values.

 

Thanks again!

Edited by pine

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×