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

Arduino RFID Keycard Access
Easy
  • 4,628
  • 21

Full instructions

Use the PN532 NFC available on the anduinoWiFi shield to create an RFID keycard building access system.

Quick Tachometer
Easy
  • 462
  • 9

Full instructions

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

New Era of Gaming on Raspberry Pi
Easy
  • 1,946
  • 8

Protip

Learn how to play Counter Strike and Diablo II on Raspberry Pi with ExaGear Desktop 2.0 3D Acceleration Update

NFC Color Changer
Easy
  • 194
  • 3

Protip

Realtime environment configuration via NDEF records and RFID tags! Just scan to change the text color!

Raspberry Pi with Windows 7
Easy
  • 1,595
  • 7

Protip

Gain all benefits from using Raspberry Pi with any Windows 7 applications that you ever needed!

Run Wine on Raspberry Pi
Easy
  • 361
  • 5

Protip

Run Wine on Raspberry Pi with ExaGear Desktop and run Windows applications from Raspbian start menu. Step-by-step instruction.

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback