diff --git a/UNHB-Esel/UNHB-Esel.ino b/UNHB-Esel/UNHB-Esel.ino index 38bb0e0..d9cec20 100644 --- a/UNHB-Esel/UNHB-Esel.ino +++ b/UNHB-Esel/UNHB-Esel.ino @@ -28,7 +28,8 @@ const uint16_t PixelCount = 64; // Currently we have a 8x8 matrix connected // make sure to set this to the correct pins // SPI Hardware Pins: CLK=GPIO14=Pin12=D5 (orange), MOSI=GPIO13=Pin13=D7 (yellow) -NeoPixelBrightnessBus strip(PixelCount); +//NeoPixelBrightnessBus strip(PixelCount); +NeoPixelBus strip(PixelCount); void setup() { Serial.begin(115200); @@ -39,7 +40,7 @@ void setup() { // this resets all the neopixels to an off state strip.Begin(); - strip.SetBrightness(brightness); + //strip.SetBrightness(brightness); strip.ClearTo(black); strip.Show(); @@ -64,7 +65,7 @@ void playBwAnimation(int animDelay, uint8_t anim[][8]) { for(int frame=0; frame<7; frame++) { for(int n=0; n>4 )] ); + strip.SetPixelColor( 2*n+1, *c[(anim[frame][n]&0x0F)] ); + } + strip.Show(); delay(animDelay); + } +} + void loop() { Serial.println("Entering loop ..."); @@ -80,7 +91,7 @@ void loop() { strip.ClearTo(black); Serial.println("Animation test ..."); - playBwAnimation(50, eye_move_cr); delay(3000); +/*playBwAnimation(50, eye_move_cr); delay(3000); playBwAnimation(50, eye_blink_r); delay(5000); playBwAnimation(50, eye_blink_r); delay(3000); playBwAnimation(50, eye_move_rc); delay(3000); @@ -89,7 +100,9 @@ void loop() { playBwAnimation(50, eye_blink_c); delay(3000); playBwAnimation(50, eye_move_cl); delay(3000); playBwAnimation(50, eye_blink_l); delay(2000); - playBwAnimation(50, eye_move_lc); delay(3000); + playBwAnimation(50, eye_move_lc); delay(3000);*/ + + playMapAnimation(150, terminator);delay(3000); /* Serial.println("Colormap test ..."); strip.ClearTo(black); diff --git a/UNHB-Esel/defaults.h b/UNHB-Esel/defaults.h index b690eb9..59689fe 100644 --- a/UNHB-Esel/defaults.h +++ b/UNHB-Esel/defaults.h @@ -5,9 +5,9 @@ uint8_t colorMap[] = { 0x00, 0x00, 0x00, 0xa1, 0xd6, 0x85, 0x45, 0x3e, 0x78, 0x76, 0x64, 0xfe, - 0x83, 0x31, 0x29, + 0x43, 0x10, 0x10, 0x9e, 0xc2, 0xe8, - 0xdc, 0x53, 0x4b, + 0xff, 0x43, 0x4b, 0xe1, 0x8d, 0x79, 0xd6, 0xb9, 0x7b, 0xe9, 0xd8, 0xa1, @@ -16,7 +16,99 @@ uint8_t colorMap[] = { 0x00, 0x00, 0x00, 0xaf, 0xaa, 0xb9, 0xf5, 0xf4, 0xeb }; -uint8_t brightness = 32; +uint8_t terminator[][32] = { { +0x00, 0x66, 0x66, 0x00, +0x06, 0x00, 0x00, 0x60, +0x60, 0x06, 0x60, 0x06, +0x60, 0x68, 0x86, 0x06, +0x60, 0x68, 0x86, 0x06, +0x60, 0x06, 0x60, 0x06, +0x06, 0x00, 0x00, 0x60, +0x00, 0x66, 0x66, 0x00 +}, +{ +0x00, 0x66, 0x66, 0x00, +0x06, 0x00, 0x00, 0x60, +0x60, 0x66, 0x00, 0x06, +0x66, 0x88, 0x60, 0x06, +0x66, 0x88, 0x60, 0x06, +0x60, 0x66, 0x00, 0x06, +0x06, 0x00, 0x00, 0x60, +0x00, 0x66, 0x66, 0x00 +}, +{ +0x00, 0x66, 0x66, 0x00, +0x06, 0x00, 0x00, 0x60, +0x66, 0x60, 0x00, 0x06, +0x68, 0x86, 0x00, 0x06, +0x68, 0x86, 0x00, 0x06, +0x66, 0x60, 0x00, 0x06, +0x06, 0x00, 0x00, 0x60, +0x00, 0x66, 0x66, 0x00 +}, +{ +0x00, 0x66, 0x66, 0x00, +0x06, 0x00, 0x00, 0x60, +0x60, 0x66, 0x00, 0x06, +0x66, 0x88, 0x60, 0x06, +0x66, 0x88, 0x60, 0x06, +0x60, 0x66, 0x00, 0x06, +0x06, 0x00, 0x00, 0x60, +0x00, 0x66, 0x66, 0x00 +}, +{ +0x00, 0x66, 0x66, 0x00, +0x06, 0x00, 0x00, 0x60, +0x60, 0x06, 0x60, 0x06, +0x60, 0x68, 0x86, 0x06, +0x60, 0x68, 0x86, 0x06, +0x60, 0x06, 0x60, 0x06, +0x06, 0x00, 0x00, 0x60, +0x00, 0x66, 0x66, 0x00 +}, +{ +0x00, 0x66, 0x66, 0x00, +0x06, 0x00, 0x00, 0x60, +0x60, 0x00, 0x66, 0x06, +0x60, 0x06, 0x88, 0x66, +0x60, 0x06, 0x88, 0x66, +0x60, 0x00, 0x66, 0x06, +0x06, 0x00, 0x00, 0x60, +0x00, 0x66, 0x66, 0x00 +}, +{ +0x00, 0x66, 0x66, 0x00, +0x06, 0x00, 0x00, 0x60, +0x60, 0x00, 0x06, 0x66, +0x60, 0x00, 0x68, 0x86, +0x60, 0x00, 0x68, 0x86, +0x60, 0x00, 0x06, 0x66, +0x06, 0x00, 0x00, 0x60, +0x00, 0x66, 0x66, 0x00 +}, +{ +0x00, 0x66, 0x66, 0x00, +0x06, 0x00, 0x00, 0x60, +0x60, 0x00, 0x66, 0x06, +0x60, 0x06, 0x88, 0x66, +0x60, 0x06, 0x88, 0x66, +0x60, 0x00, 0x66, 0x06, +0x06, 0x00, 0x00, 0x60, +0x00, 0x66, 0x66, 0x00 +}, +{ +0x00, 0x66, 0x66, 0x00, +0x06, 0x00, 0x00, 0x60, +0x60, 0x06, 0x60, 0x06, +0x60, 0x68, 0x86, 0x06, +0x60, 0x68, 0x86, 0x06, +0x60, 0x06, 0x60, 0x06, +0x06, 0x00, 0x00, 0x60, +0x00, 0x66, 0x66, 0x00 +} +}; + +uint8_t brightness = 64; uint8_t eye_blink_c[][8] = { {