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

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

Similar projects you might like

Raspberry Pi and any ARM devices Gaming Emulator
Easy
  • 261
  • 1

Protip

Play your favorite PC games on Raspberry Pi (or any ARM) - Might and Magic 6, Stronghold Crusader, Pharaoh and Cleopatra and more.

Charlieplexing with Freescale
Easy
  • 384
  • 7

Full instructions

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

Quick Tachometer
Easy
  • 560
  • 9

Full instructions

This is a small, photoresistor-based tachometer for use on several different development boards (whatever you might have laying around).

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

Protip

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

Jack and Coke Bot
Easy
  • 286
  • 5

Pour the perfect Jack and Coke every time.

Automatic Temperature Based Fan Control (for Media Cabinets)
Easy
  • 2,432
  • 13

Full instructions

Media cabinets often get very hot. This project combines a temperature sensor with a fan to cool them down.

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login