Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NeoPixelI2cSlave NeoPixelI2cSlave
Diff: Effects/effect.cpp
- Revision:
- 1:f544810b6598
- Child:
- 3:7d32f46a38d3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Effects/effect.cpp Mon Nov 23 18:50:01 2015 +0000
@@ -0,0 +1,38 @@
+#include "effect.h"
+
+namespace Effects {
+
+ Effect::Effect(NeoPixelString * pixelstring, int delay_ms) {
+ this->pixelstring = pixelstring;
+ this->delay_ms = delay_ms;
+
+ execute_effect = false;
+ }
+
+ NeoPixelString * Effect::getPixelString(void) {
+ return this->pixelstring;
+ }
+
+ void Effect::start(void) {
+ execute_effect = false;
+ ticker.attach(this, &Effect::tick, delay_ms/1000.0);
+ }
+
+ void Effect::stop(void) {
+ ticker.detach();
+ execute_effect = false;
+ }
+
+ void Effect::tick(void) {
+ execute_effect = true;
+ }
+
+ void Effect::execute(void) {
+ execute_effect = false;
+ }
+
+ bool Effect::needsExecutionTime(void) {
+ return execute_effect;
+ }
+
+};
\ No newline at end of file