Un ejemplo de uso de la Miniblip con potenciómetro

Dependencies:   PixelArray USBDevice mbed

Fork of blip_rainbow by Alberto Piganti

Files at this revision

API Documentation at this revision

Comitter:
jjmerelo
Date:
Mon Nov 30 11:40:15 2015 +0000
Parent:
5:35b3af0c06ba
Commit message:
Cambiando potencia

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 35b3af0c06ba -r 482c4dccb291 main.cpp
--- a/main.cpp	Mon Nov 30 11:27:01 2015 +0000
+++ b/main.cpp	Mon Nov 30 11:40:15 2015 +0000
@@ -10,7 +10,6 @@
 #define MATRIX_PIN P0_9
 #define NLEDS 25
 
-
 AnalogIn   ain(P0_22);
 
 unsigned int counter = 0;   
@@ -19,14 +18,12 @@
 neopixel::Pixel buffer[NLEDS];
 PwmOut speaker(P0_8);
 
-
 void setPixel(uint32_t posicion, uint8_t red, uint8_t green, uint8_t blue) {
   buffer[posicion].red=red;
   buffer[posicion].green=green;
   buffer[posicion].blue=blue;
 }
 
-
 int main()
 {
     // Turn off miniblip buzzer
@@ -34,7 +31,7 @@
 
     serial.printf("Hello world!\n");    
     while(true) {   
-        float pot = ain.read() * 100.0f;
+        float pot = ain.read() * 50.0f;
         serial.printf("mini blip is alive for %i seconds.\n", counter);
         serial.printf("Pot: %3.3f%%\n", pot);
         counter++;