Things used in this project

Hardware components:
Hexiwear docking bd
NXP Hexiwear
×1
Software apps and online services:
mBed OS online compiler

Custom parts and enclosures

Enclosure with Reset Button (.f3d)
The title says it all. This is a case for the Hexiwear! This case also make it easier to press the MK64 reset button located inside the Hexiwear.
MotionWear Case.f3d
MotionWearCaseForPrint.f3d
Print ready version in .f3d format

No document.

MotionWearCaseForPrint.stl
Print ready version in .stl format

Schematics

Development board
In order to get the program on the Hexiwear, you will need a Hexiwear Docking Station
Img 0672

Code

main.cppC/C++
The main code file
#include "mbed.h"
#include "FXAS21002.h"
#include "Hexi_OLED_SSD1351.h"

SSD1351 oled(PTB22,PTB21,PTC13,PTB20,PTE6, PTD15);
FXAS21002 gyro(PTC11,PTC10);

float gyDat[3];
int Dat[30];
//int Dat[6];
float rms=0.0;
char txt[20];
int x=0, y;
long notAvDat;

// main() runs in its own thread in the OS
// (note the calls to Thread::wait below for delays)
int main() {
    //setup oled
    oled_text_properties_t txtProp = {0};
    oled.GetTextProperties(&txtProp);
    oled.DimScreenON();
    oled.FillScreen(COLOR_BLACK);
    
    gyro.gyro_config();
    for(int l=0;l<24;l++){
        for(int l=0;l<30;l++){
        //for(int l=0;l<6;l++){
            gyro.acquire_gyro_data_dps(gyDat);
            rms = sqrt(((gyDat[0]*gyDat[0])+(gyDat[1]*gyDat[1])+(gyDat[2]*gyDat[2]))/3);
            int rrms= (int) rms;
            y= rrms*96/1000;
          
            Dat[l]=y;
            //Thread::wait(10000);
            Thread::wait(60000);
        }
        for(int l=0;l<30;l++){
        //for(int l=0;l<6;l++){
            notAvDat+= Dat[l];
        }
        y=notAvDat/30;
        //y=notAvDat/6;
        oled.DrawBox(x, 95-y, 4, y, COLOR_WHITE);
        x+=4;
    } 
    x=0;
}
Motion_HEXIWEAR
Binary code of MotionWear. Drag and drop this into the "DAPLINK" Mass storage drive.

Credits

Mylogo
MicroBob
5 projects • 33 followers
DIY technology hobbyist
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaBlog