Source code for the Curilights Controller. See http://www.saccade.com/writing/projects/CuriController/ for details.

Dependencies:   FatFileSystem mbed

This is the source code for the Curilights controller. This lets you interactively control a string of Curilights. It provides a simple click-wheel user interface for changing colors, brightness and behavior. It responds to movement and lighting.

Finished Controller

/media/uploads/isonno/nxp3872_controllerclose.jpg

System Block Diagram

/media/uploads/isonno/blockdiagram.png

Revision:
1:d1da77023e6a
Parent:
0:6da5625a6946
Child:
3:0ac64c4ca40f
--- a/UIMenu.cpp	Thu Dec 29 01:59:53 2011 +0000
+++ b/UIMenu.cpp	Sun Jan 15 09:07:04 2012 +0000
@@ -37,7 +37,7 @@
     }
 }
 
-void PushKnobUI::SwitchTo( PushKnobUI * other )
+void PushKnobUI::SwitchControl( PushKnobUI * other )
 {
     other->ConnectDevices( fKnob, fKnobButton );
     fKnob = NULL;
@@ -128,6 +128,13 @@
     Wake();
     printf("Selected %s\n\r", fLabels[fSelectedItem].c_str() );
 }
+
+void UIMenu::SwitchTo( UIMenu * nextMenu )
+{
+    Display( false );
+    SwitchControl( nextMenu );
+    nextMenu->Display( true );
+}
     
 // Parameters controlling the display layout
 const int kLineSpace = 20;
@@ -157,6 +164,7 @@
     if (on)
     {
         fDisplayOn = true;
+        fLCD->clear( BLACK, 0, 0, 131, kLineSpace + kTopGap );
         fLCD->clear( GRAY, 0, kLineSpace + kTopGap-1, 131, kLineSpace + kTopGap );
         if (! fHeader.empty())
             fLCD->draw_glyph_text( WHITE, BLACK, 2, kLineSpace-2, fHeader.c_str() );