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: m3Dpi MQTT-Thermostat-example Final_project_Tran Final_project_Tran ... more
EffectManager.cpp@3:edc6e64bfc65, 2015-10-21 (annotated)
- Committer:
- sillevl
- Date:
- Wed Oct 21 17:12:10 2015 +0000
- Revision:
- 3:edc6e64bfc65
- Child:
- 4:a7a26506c62f
RGB fun!
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| sillevl | 3:edc6e64bfc65 | 1 | |
| sillevl | 3:edc6e64bfc65 | 2 | #include "EffectManager.h" |
| sillevl | 3:edc6e64bfc65 | 3 | |
| sillevl | 3:edc6e64bfc65 | 4 | |
| sillevl | 3:edc6e64bfc65 | 5 | EffectManager::EffectManager(RGB* led){ |
| sillevl | 3:edc6e64bfc65 | 6 | this->led = led; |
| sillevl | 3:edc6e64bfc65 | 7 | effect = new CycleEffect(led); |
| sillevl | 3:edc6e64bfc65 | 8 | } |
| sillevl | 3:edc6e64bfc65 | 9 | |
| sillevl | 3:edc6e64bfc65 | 10 | void EffectManager::next(){ |
| sillevl | 3:edc6e64bfc65 | 11 | effectIndex++; |
| sillevl | 3:edc6e64bfc65 | 12 | if(effectIndex > 3) effectIndex = 0; |
| sillevl | 3:edc6e64bfc65 | 13 | switch(effectIndex){ |
| sillevl | 3:edc6e64bfc65 | 14 | case 0: |
| sillevl | 3:edc6e64bfc65 | 15 | effect = new PoliceEffect(led); |
| sillevl | 3:edc6e64bfc65 | 16 | break; |
| sillevl | 3:edc6e64bfc65 | 17 | case 1: |
| sillevl | 3:edc6e64bfc65 | 18 | effect = new HeartBeatEffect(led); |
| sillevl | 3:edc6e64bfc65 | 19 | break; |
| sillevl | 3:edc6e64bfc65 | 20 | case 3: |
| sillevl | 3:edc6e64bfc65 | 21 | effect = new CycleEffect(led); |
| sillevl | 3:edc6e64bfc65 | 22 | break; |
| sillevl | 3:edc6e64bfc65 | 23 | } |
| sillevl | 3:edc6e64bfc65 | 24 | } |
| sillevl | 3:edc6e64bfc65 | 25 | |
| sillevl | 3:edc6e64bfc65 | 26 | void EffectManager::run(){ |
| sillevl | 3:edc6e64bfc65 | 27 | effect->run(); |
| sillevl | 3:edc6e64bfc65 | 28 | } |