Firmware for the Software 3D Accelerometer Tester v1.1 or above

Dependencies:   MMA7660FC MODSERIAL mbed

I wrote a C# software that test the principal characteristics of this accelerometer MMA7660FC.


The software is here: 3D Accelerometer Tester v1.1
Is required Microsoft .NET Framework 3.5 or above.


This is the pins assignment:

MMA7660 pinsMbed pins
1 - SCLP10 - SCL
2 - SDAP9 - SDA
3 - VccVout - 3.3V
4 - GNDGND
5 - INTP6

NOTE: The I2C bus is already connected to pull-up resistor.


Some screens:

/media/uploads/edodm85/acc_img1.jpg

First you must set the Serial Port and press the button "Connect".
Then you can read the Sensor data (G acc and Orientation) manually pressing the button "Read DATA" or triggered by interrupt if you enabled in the second tab the checkbox "G Interrup Enable".
The red ball changes when the checkbox "SHAKE enable" is enabled.


/media/uploads/edodm85/acc_img2.jpg

In this screen you can set and read the registers manually or you can set easy the sample rate, the Shake Interrupt or the G Interrupt.


/media/uploads/edodm85/acc_img3.jpg

In this graph are plotted the G data read from the sensor.


For more infos visit this page.

Committer:
edodm85
Date:
Wed Aug 07 20:10:15 2013 +0000
Revision:
0:1cef37031a2c
First version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
edodm85 0:1cef37031a2c 1 #include "mbed.h"
edodm85 0:1cef37031a2c 2 #include "MODSERIAL.h"
edodm85 0:1cef37031a2c 3 #include "MMA7660FC.h"
edodm85 0:1cef37031a2c 4
edodm85 0:1cef37031a2c 5
edodm85 0:1cef37031a2c 6 bool bCheckINT = false;
edodm85 0:1cef37031a2c 7 bool new_send = false;
edodm85 0:1cef37031a2c 8
edodm85 0:1cef37031a2c 9
edodm85 0:1cef37031a2c 10 #define ADDR_MMA7660 0x98 // I2C SLAVE ADDR MMA7660FC
edodm85 0:1cef37031a2c 11
edodm85 0:1cef37031a2c 12 MMA7660FC MMA(p9, p10, ADDR_MMA7660); // sda, scl, Addr
edodm85 0:1cef37031a2c 13 InterruptIn INT(p6); // INT pin of the device
edodm85 0:1cef37031a2c 14
edodm85 0:1cef37031a2c 15 MODSERIAL pc(USBTX, USBRX);
edodm85 0:1cef37031a2c 16
edodm85 0:1cef37031a2c 17 DigitalOut led1(LED1);
edodm85 0:1cef37031a2c 18 DigitalOut led4(LED4);
edodm85 0:1cef37031a2c 19
edodm85 0:1cef37031a2c 20 //RESET
edodm85 0:1cef37031a2c 21 extern "C" void mbed_reset();
edodm85 0:1cef37031a2c 22
edodm85 0:1cef37031a2c 23 //Serial
edodm85 0:1cef37031a2c 24 char word[25];
edodm85 0:1cef37031a2c 25
edodm85 0:1cef37031a2c 26 void parse_cmd();