Program to resistive fabric network to detect ring seal on CPR mask. Uses feeback from neopixel LEDs to demonstrate secure seal. Uses NeoStrip library for NeoPixel methods and class.
Fork of NeoStrip by
Revision 2:d607600a697d, committed 2016-11-25
- Comitter:
- jamesmsong
- Date:
- Fri Nov 25 00:52:48 2016 +0000
- Parent:
- 0:9f237b11f0a8
- Child:
- 3:343fa1d679f7
- Commit message:
- 24Nov
Changed in this revision
NeoStrip.cpp | Show annotated file Show diff for this revision Revisions of this file |
NeoStrip.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/NeoStrip.cpp Wed Mar 12 18:36:58 2014 +0000 +++ b/NeoStrip.cpp Fri Nov 25 00:52:48 2016 +0000 @@ -1,15 +1,4 @@ -/********************************************** - * NeoStrip.cpp - * - * Allen Wild - * March 2014 - * - * Controls a strip of Adafruit NeoPixels, addressable RGB LEDs - * Currently, because of the global nature of the IO register and bitmask variables, - * it is only possible to use one NeoStrip instance at a time. - * - * This library supports only the NXP LPC1768! - */ + #include "mbed.h" #include "NeoStrip.h" @@ -90,4 +79,23 @@ wait_us(50); // wait 50us for the reset pulse } +void NeoStrip::initialize() +{ + for (int i = 0; i < 4; i++) + { + setPixel(i, 255, 0, 0); + write(); + } +} +void NeoStrip::progress(float time) +{ + for (int i = 0; i < 4; i++) + { + if(time > (i+1)*0.25) + { + setPixel(i, 0, 255, 0); + write(); + } + } +}
--- a/NeoStrip.h Wed Mar 12 18:36:58 2014 +0000 +++ b/NeoStrip.h Fri Nov 25 00:52:48 2016 +0000 @@ -1,11 +1,3 @@ -/** - * NeoStrip.h - * - * Allen Wild - * March 2014 - * - * Library for the control of Adafruit NeoPixel addressable RGB LEDs. - */ #ifndef NEOSTRIP_H @@ -93,6 +85,10 @@ * at the end. */ void write(); + + void initialize(); + + void progress(float time); protected: NeoColor *strip; // pixel data buffer modified by setPixel() and used by neo_out()