Giter VIP home page Giter VIP logo

ble-sketch's Introduction

BLE-Sketch

#Introduction

This repo contains several sketches used to mock ECG data and broadcast it via Bluetooth Smart (Bluetooth Low Energy) from a Redbear Lab Blend Micro board.

The .ino files can be opened, edited and uploaded to the device with Arduino IDE software.

In all sketch files, the write frequency can be adjusted in the loop() functions by changing the number of miliseconds passed into delay().

##RBL_nRF8001.h:## This is a library file that has been modified to suit the needs of our data transmission and should replace the library file in your local Arduino Library directory. The modification is small and can be found in the ble_write_bytes() function on line 164. To prevent data stacking in the transmission write buffer, we reset the buffer length to zero before every write.

##BLE-NSR.ino:## This sketch broadcasts a mock Normal Sinus Rhythm (NSR, normal heart rythm) every 50ms in an infinite loop. This is achieved by mocking a QRS complex of 9 datapoints followed by 4 flatline datapoints (adjustable), giving consisten r-wave intervals.

##BLE-arrhythmia.ino:## This sketch broadcasts mock arrhythmia ECG data every 50ms in an infinite loop. This is achieved by mocking a QRS complex of 9 datapoints followed by either 0 to 4 flatline datapoints (adjustable), giving greater variance among r-wave intervals.

##BLE-Sketch.ino## This sketch broadcasts 180 points of real ECG NSR data every 50ms. A light on the Arduino board flashes coorespondingly every 50ms.

##LogSampleIntoCLangArray.js## A JS file you can run to convert an object in the following format: [ { "x": 14.992 , "y": 4.985 }, { "x": 14.994 , "y": 4.995 } ]

by outputting the result to the console, a C++ array in the following format:

char *test178 = "4.495"; char *test179 = "4.950";

testData[178] = (unsigned char *)test178; testData[179] = (unsigned char *)test179;

The data resolution interval can be set at the top of the file.

The data object included in this file consists of around 5000 real ECG NSR datapoints read at 3ms per point.

ble-sketch's People

Contributors

bernardchu avatar cdepman avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.