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

DIY technology hobbyist

Replications

Did you replicate this project? Share it!

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

Give feedback

Comments

Similar projects you might like

Nilakantha series
Easy
  • 40
  • 0

Protip

Calculate Pi with Nilakantha series at Hexiwear

Charlieplexing with Freescale
Easy
  • 333
  • 7

Full instructions

Charlieplexing uses the tri-state logic capabilities of microcontrollers in order to gain efficiency over traditional multiplexing.

Jack and Coke Bot
Easy
  • 223
  • 5

Pour the perfect Jack and Coke every time.

Setting Up GPIO, PWM, I2C for K82 Freedom Board in KDS
Easy
  • 980
  • 10

Protip

A helping hand for the novices like me to set up Output on other available pins of K82 Freedom

Mongoose embedded networking library on NXP LPC
Easy
  • 109
  • 3

Protip

Mongoose, the most popular open source embedded web server and networking library now supports the NXP LPC. QSB + LPCXpresso sample project.

WS2812 Christmas tree
Easy
  • 199
  • 4

Work in progress

193 WS2812 leds in 7 rings combined with a laser cutter acrylic frame to a tiny shiny christmas tree.

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback