Jump to content
43oh

[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

Link to post
Share on other sites
  • 2 months later...

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!

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
Link to post
Share on other sites
  • 5 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...