![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Un script para cambiar el color
Dependencies: PixelArray USBDevice mbed
Fork of blip_rainbow_ejemplo by
Diff: main.cpp
- Revision:
- 6:482c4dccb291
- Parent:
- 4:8eac4e92928a
- Child:
- 7:e5c1d481ad40
--- 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++;