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.
Dependencies: EthernetInterfacePlusHostname RdWebServer mbed-rtos mbed
Diff: DrawingManager.cpp
- Revision:
- 5:910909f34907
- Parent:
- 4:b521815f2657
- Child:
- 6:8df79fe1afcd
diff -r b521815f2657 -r 910909f34907 DrawingManager.cpp
--- a/DrawingManager.cpp Mon Aug 31 15:21:47 2015 +0000
+++ b/DrawingManager.cpp Tue Sep 01 15:53:52 2015 +0000
@@ -5,6 +5,7 @@
#include "DrawingManager.h"
#include "rtos.h"
+#include "colourconverters.h"
DrawingManager::DrawingManager()
{
@@ -68,6 +69,24 @@
pLedStrip->ShowLeds();
}
+void DrawingManager::DisplayIdle(unsigned int stepCount)
+{
+ // Display a step in an auto sequence
+ if (!pLedStrip)
+ return;
+ if (pLedStrip->IsBusy())
+ return;
+ pLedStrip->Clear();
+ int ledsPerGroup = pLedStrip->GetNumLeds() / 10;
+ for (int i = 0; i < pLedStrip->GetNumLeds(); i += ledsPerGroup)
+ {
+ RgbColor colrVal((stepCount * 7) + (i * 23) % 64, (stepCount * 17) + 77 + (i * 3) % 64, (stepCount * 37) + 117 + (i * 13) % 64);
+ RgbColor colrVal2((stepCount * 17) + (i * 33) % 64, (stepCount * 3) + 13 + (i * 13) % 64, (stepCount * 77) + 11 + (i * 23) % 64);
+ pLedStrip->Fill(i,ledsPerGroup,colrVal.r, colrVal.g, colrVal.b, colrVal2.r, colrVal2.g, colrVal2.b);
+ }
+ pLedStrip->ShowLeds();
+}
+
int DrawingManager::GetIntFromNameValPair(char* buf, char* name, int invalidVal)
{
int val = invalidVal;
@@ -76,3 +95,4 @@
val = atoi(pFnd + strlen(name));
return val;
}
+