Un script para cambiar el color

Dependencies:   PixelArray USBDevice mbed

Fork of blip_rainbow_ejemplo by JJ Merelo

Revision:
8:ef1c8d16f063
Parent:
7:e5c1d481ad40
Child:
9:297dd05aecfd
--- a/main.cpp	Mon Nov 30 12:14:18 2015 +0000
+++ b/main.cpp	Mon Nov 30 12:39:43 2015 +0000
@@ -36,16 +36,14 @@
         serial.printf("Pot: %3.3f%%\n", pot);
         counter++;  
     
+        int rgb = 20* floor( pot/50 ); 
         neopixel::PixelArray array(MATRIX_PIN);
         for(int i=0;i<NLEDS;i++) {
-            setPixel(i, pot, 255-pot, 255-pot);
+            setPixel(i, rgb, 255-rgb, 255-rgb);
         }
-        
-        float note=500+(pot)/100;
-        speaker.period(1.0/note);           
-        speaker = 50.0;
-        
-        array.update(buffer, NLEDS);  
+                
+        array.update(buffer, NLEDS); 
+        wait(10); 
 
     }