message:
How can I modify Arduino code to work with ATtiny85?

[![Circuit designed to work with ATtiny85][1]][1]Push a tactile switch to cycle through several different patterns on the LED strips. I want to modify the Arduino code so that I can use the ATtiny85 instead.
*****The code posted here works on the Arduino Uno with a 10k pull-up resistor wired to the push button at pin 11 on the Arduino.

<!-- language: lang-cpp -->

    /***************************************************************************/
    //            Hardware: RadioShack Tricolor LED Strip
    //            Arduino IDE: Arduino-1.0
    //            Date:      April 17, 2013
    //            Copyright© 2013 RadioShack Corporation
    //
    //  This library is free software; you can redistribute it and/or
    //  modify it under the terms of the GNU Lesser General Public
    //  License as published by the Free Software Foundation; either
    //  version 2.1 of the License, or (at your option) any later version.
    //
    //  This library is distributed in the hope that it will be useful,
    //  but WITHOUT ANY WARRANTY; without even the implied warranty of
    //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    //  Lesser General Public License for more details.
    //
    //  You should have received a copy of the GNU Lesser General Public
    //  License along with this library; if not, see <http://www.gnu.org/licenses/>
    //
    /*****************************************************************************/

    #include <avr/pgmspace.h>

    // ******** DEBUG ==== should auto config to adapt different mother board *********
    #define DATA_1 (PORTC |=  0X01)    // DATA 1    // for UNO
    #define DATA_0 (PORTC &=  0XFE)    // DATA 0    // for UNO
    #define STRIP_PINOUT (DDRC=0xFF)    // for UNO

    int val = 0; //variable to read button pin value
    int buttonPin = 11; //button pin variable, 11 on the Arduino
    int sequence = 1; //variable to hold current sequence

    PROGMEM const unsigned long pattern_test_blue_comet_red_bg[][20] = {
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},

    };

    PROGMEM const unsigned long pattern_test_disco[][20] = {
      {0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011},
      {0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022},
      {0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033},
      {0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044},
      {0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055},
      {0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066},
      {0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077},
      {0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088},
      {0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099},
      {0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa},
      {0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb},
      {0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc},
      {0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd},
      {0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000},
      {0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000},
      {0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000},
      {0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000},
      {0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000},
      {0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000},
      {0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000},
      {0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000},
      {0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000},
      {0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000},
      {0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000},
      {0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000},
      {0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000},
      {0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000},
      {0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000},
      {0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100},
      {0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200},
      {0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300},
      {0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400},
      {0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500},
      {0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600},
      {0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700},
      {0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800},
      {0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900},
      {0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00},
      {0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00},
      {0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00},
      {0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00},
      {0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00},
      {0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00},
    };

    PROGMEM const unsigned long pattern_test_pink[][20] = {
      {0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff},
    };

    PROGMEM const unsigned long pattern_test_purple[][20] = {
      {0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66},
    };

    PROGMEM const unsigned long pattern_test_blue[][20] = {
      {0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00},
    };

    PROGMEM const unsigned long pattern_test_green[][20] = {
      {0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000},
    };

    PROGMEM const unsigned long pattern_test_yellow[][20] = {
      {0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff},
    };

    PROGMEM const unsigned long pattern_test_white[][20] = {
      {0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff},
    };

    PROGMEM const unsigned long pattern_test_red[][20] = {
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
    };

    // ***********************************************************************************************************
    // *
    // *                            Power Up Init.
    // *
    // *
    // ***********************************************************************************************************
    void setup() {

      STRIP_PINOUT;        // set output pin - DEBUG: should auto detect which mother board for use

      reset_strip();
      //noInterrupts();

    }

    // ***********************************************************************************************************
    // *
    // *                            Main Loop
    // *
    // *
    // ***********************************************************************************************************
    void loop()
    {

      val = digitalRead(buttonPin);
      if (val == LOW)
      {
        if (sequence == 9)
        {
          sequence = 1;
        } else
        {
          sequence++;
        }
        delay(200);
      }

      switch (sequence)
      {
        case 1:
          send_1M_pattern(pattern_test_pink, 1, 5);
          delay(1);
          break;
        case 2:
          send_1M_pattern(pattern_test_purple, 1, 5);
          delay(1);
          break;
        case 3:
          send_1M_pattern(pattern_test_blue, 1, 5);
          delay(1);
          break;
        case 4:
          send_1M_pattern(pattern_test_green, 1, 5);
          delay(1);
          break;
        case 5:
          send_1M_pattern(pattern_test_yellow, 1, 5);
          delay(1);
          break;
        case 6:
          send_1M_pattern(pattern_test_white, 1, 5);
          delay(1);
          break;
        case 7:
          send_1M_pattern(pattern_test_red, 1, 5);
          delay(1);
          break;
        case 8:
          send_1M_pattern(pattern_test_blue_comet_red_bg, 43, 45);
          delay(1);
          break;
        case 9:
          send_1M_pattern(pattern_test_disco, 45, 5);
          delay(1);
          break;
      }

      //delay(1);
    }

    /*******************************************************************************
       Function Name  : send_1M_pattern
       Description    : Transmit pattern to whole 1 meter strip
       Input          : pointer to ROM pattern; pattern length; frame rate
       Output         : None
       Return         : None
     *******************************************************************************/
    void send_1M_pattern(const unsigned long data[][20], int pattern_no, int frame_rate)
    {
      int i = 0;
      int j = 0;
      uint32_t temp_data;

      for (i = 0; i < pattern_no; i++)
      {
        noInterrupts();
        for (j = 0; j < 20; j++)
        {
          temp_data = pgm_read_dword_near(&data[i][j]);
          send_strip(temp_data);
        }
        interrupts();

        delay(frame_rate);

      }
    }

    /*******************************************************************************
       Function Name  : send_strip
       Description    : Transmit 24 pulse to LED strip
       Input          : 24-bit data for the strip
       Output         : None
       Return         : None
     *******************************************************************************/
    void send_strip(uint32_t data)
    {
      int i;
      unsigned long j = 0x800000;

      for (i = 0; i < 24; i++)
      {
        if (data & j)
        {
          DATA_1;
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");

          /*----------------------------*/
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          /*----------------------------*/
          DATA_0;
        }
        else
        {
          DATA_1;
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          DATA_0;
          /*----------------------------*/
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          __asm__("nop\n\t");
          /*----------------------------*/
        }

        j >>= 1;
      }
    }

    /*******************************************************************************
       Function Name  : reset_strip
       Description    : Send reset pulse to reset all color of the strip
       Input          : None
       Output         : None
       Return         : None
     *******************************************************************************/
    void  reset_strip()
    {
      DATA_0;
      delayMicroseconds(20);
    }

  [1]: https://i.stack.imgur.com/p4QDa.jpg

body:
Try replacing the lines

    #define DATA_1 (PORTC |=  0X01)    // DATA 1    // for UNO
    #define DATA_0 (PORTC &=  0XFE)    // DATA 0    // for UNO
    #define STRIP_PINOUT (DDRC=0xFF)    // for UNO
    int buttonPin = 11; //button pin variable, 11 on the Arduino

with

    #define DATA_1 (PORTB |=  0X01)    // DATA 1    // on PB0
    #define DATA_0 (PORTB &=  0XFE)    // DATA 0    // on PB0
    #define STRIP_PINOUT (DDRB=0x01)    // PB0 as output
    int buttonPin = 3; //button pin variable, pin 3 = PB3

Connect the push button between PB3 and GND, with an external pullup.
Connect PB0 to the data input of the LED strip.

If the program doesn't fit in the flash, try removing one of the largest
patterns. Otherwise, if it almost fits, you could try to optimize it to
make it smaller.

------------------------------------------------------------------------

**Edit**: I modified the original code and added some optimizations.
Notably, I removed all dependencies to the Arduino core, which makes it
significantly smaller. Now it fits in the flash memory of the ATtiny85
without removing any pattern.

This is a polyglot: it should compile either as a .ino sketch, as a
plain C program, or as a C++ program.

Here is the code:

    /***************************************************************************/
    //            Hardware: RadioShack Tricolor LED Strip
    //            Arduino IDE: Arduino-1.0
    //            Date:      April 17, 2013
    //            Copyright© 2013 RadioShack Corporation
    //
    //  This library is free software; you can redistribute it and/or
    //  modify it under the terms of the GNU Lesser General Public
    //  License as published by the Free Software Foundation; either
    //  version 2.1 of the License, or (at your option) any later version.
    //
    //  This library is distributed in the hope that it will be useful,
    //  but WITHOUT ANY WARRANTY; without even the implied warranty of
    //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    //  Lesser General Public License for more details.
    //
    //  You should have received a copy of the GNU Lesser General Public
    //  License along with this library; if not, see <http://www.gnu.org/licenses/>
    //
    /*****************************************************************************/
    // Modified to work on an ATtiny85 by Edgar Bonet -- 2017-12-12.
    //
    // Wiring:
    //   - connect a push button between PB3 and GND
    //   - connect PB0 to the data input of the LED strip
    //
    // Compile:
    //   avr-gcc -mmcu=attiny85 -Os -Wall -Wextra -DF_CPU=8000000
    //   Tricolor-LED-Strip.c -o Tricolor-LED-Strip.elf
    /*****************************************************************************/

    #include <avr/pgmspace.h>
    #include <avr/io.h>
    #include <avr/interrupt.h>
    #include <util/delay.h>

    // Change this if you want to use different pins.
    #define DATA_PIN   PB0
    #define BUTTON_PIN PB3

    void send_1M_pattern(const unsigned long data[][20], uint8_t pattern_no, uint8_t frame_rate);
    void send_strip(uint32_t data);
    void reset_strip();

    static void short_delay(uint8_t ms)
    {
      while (ms--) _delay_ms(1);
    }

    PROGMEM const unsigned long pattern_test_blue_comet_red_bg[][20] = {
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100, 0x00ff00},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x001100},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x0000ff, 0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x00ff00, 0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x001100, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},

    };

    PROGMEM const unsigned long pattern_test_disco[][20] = {
      {0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011, 0x000011},
      {0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022, 0x000022},
      {0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033, 0x000033},
      {0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044, 0x000044},
      {0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055, 0x000055},
      {0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066, 0x000066},
      {0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077, 0x000077},
      {0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088, 0x000088},
      {0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099, 0x000099},
      {0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa, 0x0000aa},
      {0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb, 0x0000bb},
      {0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc, 0x0000cc},
      {0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd, 0x0000dd},
      {0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee, 0x0000ee},
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
      {0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000, 0x110000},
      {0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000, 0x220000},
      {0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000, 0x330000},
      {0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000, 0x440000},
      {0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000, 0x550000},
      {0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000, 0x660000},
      {0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000, 0x770000},
      {0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000, 0x880000},
      {0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000, 0x990000},
      {0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000, 0xaa0000},
      {0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000, 0xbb0000},
      {0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000, 0xcc0000},
      {0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000, 0xdd0000},
      {0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000, 0xee0000},
      {0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000},
      {0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100, 0x001100},
      {0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200, 0x002200},
      {0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300, 0x003300},
      {0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400, 0x004400},
      {0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500, 0x005500},
      {0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600, 0x006600},
      {0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700, 0x007700},
      {0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800, 0x008800},
      {0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900, 0x009900},
      {0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00, 0x00aa00},
      {0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00, 0x00bb00},
      {0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00, 0x00cc00},
      {0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00, 0x00dd00},
      {0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00, 0x00ee00},
      {0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00},
    };

    PROGMEM const unsigned long pattern_test_pink[][20] = {
      {0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff, 0x00ffff},
    };

    PROGMEM const unsigned long pattern_test_purple[][20] = {
      {0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66, 0x00cc66},
    };

    PROGMEM const unsigned long pattern_test_blue[][20] = {
      {0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00},
    };

    PROGMEM const unsigned long pattern_test_green[][20] = {
      {0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000, 0xff0000},
    };

    PROGMEM const unsigned long pattern_test_yellow[][20] = {
      {0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff, 0xff00ff},
    };

    PROGMEM const unsigned long pattern_test_white[][20] = {
      {0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff},
    };

    PROGMEM const unsigned long pattern_test_red[][20] = {
      {0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff},
    };

    static const struct {
      const unsigned long (*data)[20];
      uint8_t pattern_no;
      uint8_t frame_rate;
    } patterns[9] = {
      {pattern_test_pink, 1, 5},
      {pattern_test_purple, 1, 5},
      {pattern_test_blue, 1, 5},
      {pattern_test_green, 1, 5},
      {pattern_test_yellow, 1, 5},
      {pattern_test_white, 1, 5},
      {pattern_test_red, 1, 5},
      {pattern_test_blue_comet_red_bg, 43, 45},
      {pattern_test_disco, 45, 5}
    };

    // ***********************************************************************************************************
    // *
    // *                            Main Program
    // *
    // *
    // ***********************************************************************************************************
    int main(void)
    {
      uint8_t sequence = 0; //variable to hold current sequence

      DDRB |= _BV(DATA_PIN);     // DATA_PIN as output
      PORTB |= _BV(BUTTON_PIN);  // internal pullup on button pin
      reset_strip();

      for (;;) {
        if ((PINB & _BV(BUTTON_PIN)) == 0) {  // if the button is pressed
          if (++sequence == 9)
            sequence = 0;
          short_delay(200);
        }
        send_1M_pattern(
          patterns[sequence].data,
          patterns[sequence].pattern_no,
          patterns[sequence].frame_rate
        );
        short_delay(1);
      }
    }

    /*******************************************************************************
       Function Name  : send_1M_pattern
       Description    : Transmit pattern to whole 1 meter strip
       Input          : pointer to ROM pattern; pattern length; frame rate
       Output         : None
       Return         : None
     *******************************************************************************/
    void send_1M_pattern(const unsigned long data[][20], uint8_t pattern_no, uint8_t frame_rate)
    {
      int i = 0;
      int j = 0;
      uint32_t temp_data;

      for (i = 0; i < pattern_no; i++)
      {
        for (j = 0; j < 20; j++)
        {
          temp_data = pgm_read_dword_near(&data[i][j]);
          send_strip(temp_data);
        }

        short_delay(frame_rate);

      }
    }

    /*******************************************************************************
       Function Name  : send_strip
       Description    : Transmit 24 pulse to LED strip
       Input          : 24-bit data for the strip
       Output         : None
       Return         : None
     *******************************************************************************/
    void send_strip(uint32_t data)
    {
      int i;
      unsigned long j = 0x800000;

      for (i = 0; i < 24; i++)
      {
        if (data & j)
        {
          PORTB |= _BV(DATA_PIN);
          _delay_us(1.75);
          PORTB &= ~_BV(DATA_PIN);
        }
        else
        {
          PORTB |= _BV(DATA_PIN);
          _delay_us(0.563);
          PORTB &= ~_BV(DATA_PIN);
          _delay_us(0.188);
        }

        j >>= 1;
      }
    }

    /*******************************************************************************
       Function Name  : reset_strip
       Description    : Send reset pulse to reset all color of the strip
       Input          : None
       Output         : None
       Return         : None
     *******************************************************************************/
    void  reset_strip()
    {
      PORTB &= ~_BV(DATA_PIN);
      _delay_us(20);
    }


sender: user

message:
Can I improve this code (replacing delays with something else)?

Building upon my previously solved question https://arduino.stackexchange.com/questions/47652/ultrasonic-sensor-range-finder-help-solved.

Is there a better way to make the LED blink than using a delay and stopping all the rest of the code? For example, the LED is set to turn on, then shortly after turn off. Is there a better way to do this?

For example, if the LED is turned on, it then delays the code, which means it has to wait for the delay to be over, turn off, then change its pattern. For example, allow the Arduino to interrupt the blink with a new interval blink, mid blink? I'm sorry if this is confusing, it's tough to explain.

Simply put, is there a better function than `delay()` that can allow the Arduino to suddenly change the state of the LED while it is waiting on a `delay()` to finish?

The code I'm working on is this:

<!-- language: lang-cpp -->

    #include <NewPing.h>
    #define TRIGGER_PIN  15
    #define ECHO_PIN     2
    #define MAX_DISTANCE 500
    int LED1 = 3;
    int LED2 = 16;
    int LED3 = 9;
    int LED4 = 6;

    NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);

    void setup() {
      pinMode(LED1, OUTPUT);
      pinMode(LED2, OUTPUT);
      pinMode(LED3, OUTPUT);
      pinMode(LED4, OUTPUT);
    }

    void loop() {
      delay(50);
      unsigned int uS = sonar.ping_median(10);
      int IN = sonar.convert_in(uS);
      if (IN <= 5) {
        analogWrite(LED4, 255);
        delay(100);
        analogWrite(LED4, 0);
      } else if (IN >= 5 && IN <= 12) {
        analogWrite(LED4, 1);
        delay(200);
        analogWrite(LED4, 0);
      } else if (IN >= 13) {
        analogWrite(LED4, 100);
        delay(300);
        analogWrite(LED4, 0);
      }
    }

sender: assistant

body:
In general, if you want two separate tasks (like controlling the LED and do something else) 'simultaneously', you should not use delay.

Instead use a long int variable to keep the time since something happened (like switching the LED color in your case). Than check in the loop how much time has passed and act on it.

E.g.

When you call analog writes with non zero values, set the variable to the current time. Than instead of the delay check if the current time minus the variable < 100 or 200 or 300 depending on the value you need and than set the analog write back to 0 (switching off the LED). In the rest of the loop you can do other tasks.


body:
You can use [millis()][1] to get a timer:<br>
[millis()][1] Returns the number of milliseconds since the Arduino board began running the current program.

    void loop(){
        if(millis() % 100 == 0){//%(modullo) is the rest of a division. 19=9 because10/10 = 1 and the rest is 9
            //you have wait 100 millisecond. When millis()0 == 0 millis() is a multiple of 100.
        }
    }

For your code you can do this:

    int LED1 = 3;
    int LED1 = 3;
    int LED2 = 16;
    int LED3 = 9;
    int LED4 = 6;

    //Ligth on -> 1 light off -> 0
    int LED1Stat = 0;
    int LED2Stat = 0;
    int LED3Stat = 0;
    int LED4Stat = 0;

    void setup() {
      // put your setup code here, to run once:
      pinMode(LED1, OUTPUT);    //every 100 ms
      pinMode(LED2, OUTPUT);    //every 250 ms
      pinMode(LED3, OUTPUT);    //every 500 ms
      pinMode(LED4, OUTPUT);    //every 1000 ms

    }

    void loop() {
        //for no Delay
        if(millis()0 = 0){
            LED1Stat = !LED1Stat;
            digitalWrite(LED1, LED1Stat);
        }
        if(millis()%0 = 0){
            LED2Stat = !LLED2Stat;
            digitalWrite(LED2, LED2Stat);
        }
        if(millis()P0 = 0){
            LED3Stat = !LED3Stat;
            digitalWrite(LED3, LED3Stat);
        }
        if(millis()00 = 0){
            LED4Stat = !LED4Stat;
            digitalWrite(LED4, LED4Stat);
        }
    }
[EDIT]

    long prevMillis = 0;
    void loop(){
        if(millis()-prevMillis >= 100){
            LED1Stat = !LED1Stat;
            digitalWrite(LED1, LED1Stat);
            prevMillis = millis();
        }
        //...

    }

  [1]: https://www.arduino.cc/reference/en/language/functions/time/millis/


body:
I think the delay function will wait until enough clock cycles are done. The function counts the cycles and you must wait for enough.

The timer/counters are a part of a microcontroller and are used for example to measure the time between two events or generating interrupt after a defined time. The advantage is you can start the timer and the code after it must not wait. When the time is over you can simply generate an interrupt and execute small code in the interrupt handler.


message:
How to use an Arduino to measure speed of rocket

I am not very experienced with Arduino and I am trying to learn it. I was wondering what is the easiest and most effective way to calculate speed and log it every second so to say. This would be mounted in a model rocket to see what speeds it can reach. How would I achieve this?

Would it be hard to send over RF to see it in real time?

Thanks in Advance

body:
Quite different questions, but you need two items:

- A gyroscope/accellerometer, I don't think this should be a problem. You need to check beforehand if the Arduino is fast enough, since a rocket acceleration is probably very high.

- An RF transceiver, there are several types which work over big distances, but I don't have experience while they move fast. Maybe radio signals might get distorted, but for that hopefully someone has a better answer. Probably you cannot use a (big) external antenna which extends outside the rocket.


body:
You can use an [accelerometer][1] or a [barometre][2] for measure speed and for RF you can use:

 - [Radio NRF24L01][3]
 - [wifi ESP8266][4]
 - [bluetooth HC-06][5]

  [1]: https://diyhacking.com/arduino-mpu-6050-imu-sensor-tutorial/
  [2]: http://arduinolearning.com/code/bmp180-barometric-pressure-sensor-example.php
  [3]: http://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/
  [4]: http://www.instructables.com/id/Quick-Start-to-Nodemcu-ESP8266-on-Arduino-IDE/
  [5]: https://create.arduino.cc/projecthub/user206876468/arduino-bluetooth-basic-tutorial-d8b737


message:
Connect optocoupler 4N35 to Arduino Uno to control LED light strips

I want to use an Arduino Uno to control the LED light strips, based on the input signal from a robot controller. The robot controller sends a digital signal with "HIGH" of 24 V and "LOW" of 0 V.  I have thought of using an optocoupler between the robot controller and the Arduino to reduce the voltage from 24 V to 5 V, suitable for the Arduino pin.

Can I connect the optocoupler's emitter to the Arduino ground?

The LED strips work on 12V DC and at 2000mA. If I power the Arduino with 12V DC power source connected to the DC jack, can I give the power to the LED's also using the V-in pin of the Arduino?

Please look at my circuit and tell me where I went wrong and why?

[![Circuit schematic][1]][1]

  [1]: https://i.stack.imgur.com/iU5P8.png

body:
> Can i connect the optocoupler's emmitter to the arduino ground?

Yes. Don't forget to either enable the internal pullup on the GPIO pin or use an external pullup on the collector.

>  If i power the arduino with 12 V D.C power source connected to the D.C jack, can i give the power to the LEDs also using the V-in pin of the arduino?

Not at the current rating you are talking about, no. The header is only rated for 1A, and the diode on the barrel jack input is also rated for only 1A.  You would need to split the LED power off from the incoming power *before* it goes into the Arduino.

The way you have your MOSFETs wired at the moment is wrong. The moment you turn one on it will let the Magic Smoke escape. You are using them to short circuit the LEDs, which is very very bad.

Each one should be wired in series with the LED between the cathode and ground:

<!-- Begin schematic: In order to preserve an editable schematic, please
     don't edit this section directly.
     Click the "edit" link below the image in the preview instead. -->

![schematic](https://i.stack.imgur.com/h0FN5.png)

<!-- End schematic -->


message:
The code is showing a error that "ledpin2 is not declared in the scope"

int ledPin1 = 1;
    int ledpin2 = 2;
    int ledpin3 = 3;
    int ledpin4 = 4;
    int ledpin5 = 5;
    int ledpin6 = 6;

    void setup()
    {
      //initialize pins as outputs
      pinMode(ledPin1, OUTPUT);
      pinMode(ledPin2, OUTPUT);
      pinMode(ledPin3, OUTPUT);
      pinMode(ledPin4, OUTPUT);
      pinMode(ledPin5, OUTPUT);
      pinMode(ledpin6, OUTPUT);
    }

    void loop()
    {
      digitalWrite(ledPin1, HIGH);
      delay(200);
      digitalWrite(ledPin2, HIGH);
      delay(200);
      digitalWrite(ledPin3, HIGH);
      delay(200);
      digitalWrite(ledPin4, HIGH);
      delay(200);
      digitalWrite(ledPin5, HIGH);
      delay(200);
      digitalWrite(ledpin5, LOW);
      digitalWrite(ledpin4, LOW);
      digitalWrite(ledpin3, LOW);
      digitalWrite(ledpin2, LOW);
      digitalWrite(ledpin1, LOW);
      digitalWrite(ledPin5, HIGH);
      delay(200);
      digitalWrite(ledPin4, HIGH);
      delay(200);
      digitalWrite(ledPin3, HIGH);
      delay(200);
      digitalWrite(ledPin2, HIGH);
      delay(200);
      digitalWrite(ledPin1, HIGH);
      delay(200);
    }

body:
You mix capitals with non capital characters.

The case of characters in variable names are important, so ledPin2 is a different variable than ledpin2.

Also, never mix similar names (unless it is trivial). Either always use ledpinx or ledPinx, not sometimes the first and sometimes the second version.

camelCasing is normally used for local variables, means the first sub-word starts with a lower case, rest with upper case, thus led-pin will become ledPin.

Pascal case is the other way: that would become LedPin in your case.

For global variables I tend to use PascalCasing, or if it is within one file, prefixed camelCasing with an underscore.


body:
I have corrected your code it was just because you mixed capital and lowercase letters while declaring `ledPin`. Keep it same everywhere in `setup()` and `loop()`.

<!-- language: lang-cpp -->

    int ledPin1 = 1;
    int ledPin2 = 2;
    int ledPin3 = 3;
    int ledPin4 = 4;
    int ledPin5 = 5;
    int ledPin6 = 6;

    void setup()
    {
        //initialize pins as outputs
        pinMode(ledPin1, OUTPUT);
        pinMode(ledPin2, OUTPUT);
        pinMode(ledPin3, OUTPUT);
        pinMode(ledPin4, OUTPUT);
        pinMode(ledPin5, OUTPUT);
        pinMode(ledPin6, OUTPUT);
    }

    void loop()
    {
        digitalWrite(ledPin1, HIGH);
        delay(200);
        digitalWrite(ledPin2, HIGH);
        delay(200);
        digitalWrite(ledPin3, HIGH);
        delay(200);
        digitalWrite(ledPin4, HIGH);
        delay(200);
        digitalWrite(ledPin5, HIGH);
        delay(200);
        digitalWrite(ledPin5, LOW);
        digitalWrite(ledPin4, LOW);
        digitalWrite(ledPin3, LOW);
        digitalWrite(ledPin2, LOW);
        digitalWrite(ledPin1, LOW);
        digitalWrite(ledPin5, HIGH);
        delay(200);
        digitalWrite(ledPin4, HIGH);
        delay(200);
        digitalWrite(ledPin3, HIGH);
        delay(200);
        digitalWrite(ledPin2, HIGH);
        delay(200);
        digitalWrite(ledPin1, HIGH);
        delay(200);
    }


message:
Need to "Extend" a Arduino Digital Signal

Here's the scenario:
We have 1 arduino uno accepting DMX and converting that to a signal that is being sent out digitally (PIN 3). The digital signal then goes to several IR LED senders that control 3,200 IR, color-changing candles. I've recently added some more senders, and now some of the senders are not working (even some that were working before). I assume this is because the digital signal has been weakened due to me splitting it so many times.

I'd like to add another arduino to control half of the IR senders. I obviously already have a cable running to every device, but I know of a perfect place to "interject" the new arduino. Is this possible? Can the second arduino essentially "repeat" or decode and re-encode the digital signal? If so, what pins am I looking at and will I need any special code?

Thanks for the help!

body:
The scenario you are referring to - connecting one output to many devices - is called the *fan-out*. Yes, a GPIO pin has a limited amount of *drive* which limits the number of devices in the *fan-out*.

There are two problems that are caused by excess fan-out:

1. Excess current draw from resistive loads
2. Excess capacitance from logic loads

The former is evident when you have too many LEDs connected directly to an output (with resistors, of course). The combined current draw of the LEDs exceeds the current the IO pin can provide and either damage the pin or the LEDs go dimmer than would be desired.

The latter is more evident when working with communication signals. The excess capacitance imposed by each gate attached to the output causes a low-pass filter effect which can filter out high-frequency signals or corrupt the waveforms by removing higher frequency components and "curving off" the nice clean square waves.

In normal logic systems it's common to use *line drivers* or *buffers* to allow the connection of more devices to a single signal. Devices such as the 74HC244, which is 8 buffers in one chip, are commonly employed. You can connect the inputs of all 8 buffers to one Arduino output, and each output from the buffer mirrors the input exactly and can connect to more devices than an Arduino can (each output has an extra 10mA steady-state drive capacity than the Arduino).

And yes, you can even connect the output of one buffer to the inputs of other buffers to give even more capacity.

<!-- Begin schematic: In order to preserve an editable schematic, please
     don't edit this section directly.
     Click the "edit" link below the image in the preview instead. -->

![schematic](https://i.stack.imgur.com/VxNif.png)

<!-- End schematic -->


body: The buffer is a good idea, each pin on an arduino can deliver 20ma, but then the chip can over heat, and you can't drive every output to 20ma, so the buffer chip is the way to go. Just consider the speed of the buffer when you are sending data. There are many chips that can do it, and many that might not be able to do it. So look at the speed of the chip from input to output. Then again, the arduino may not be able to keep up. So consider a PIC, some PIC's are really fast compared to an arduino.


message:
Getting my keypad to reset when wrong password is entered

I am working on a puzzle for my nephew. I currently have an arduino mega, SD card reader and keypad. Everything is wired correctly and I have it currently programmed so when you enter the right password than an audio file plays and a green LED lights up. Where I am struggling is I do not know how to program it so that when the wrong pass code is entered then my red LED light flashes and the code resets to position 0. I also noticed that my current password is 1,2,3 and when I add a random number between my pass code, say, 1,5,2,3 or even 1,3,2,2,3 then the audio file still plays and my green LED lights up. Any suggestions?

    #include <Keypad.h>
    #include <SD.h>
    #include <TMRpcm.h>
    #define SD_ChipSelectPin 53

    TMRpcm tmrpcm;
    char* password = "123";
    int position = 0;
    const byte ROWS = 4;
    const byte COLS = 4;
    char keys[ROWS][COLS] = {
      {'1','2','3','A'},
      {'4','5','6','B'},
      {'7','8','9','C'},
      {'*','0','#','D'}
    };

    byte rowPins[ROWS] = { 8, 7, 6, 9 };
    byte colPins[COLS] = { 5, 4, 3, 2 };
    Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
    int R = 12;
    int G = 13;

    void setup(){
      pinMode(R, OUTPUT);
      pinMode(G, OUTPUT);

      LockedPosition(true);
      tmrpcm.speakerPin = 46;
      if (!SD.begin(SD_ChipSelectPin)) {
        return;
      }
    }

    void loop()
    {
      char key = keypad.getKey();
      if (key == '*' || key == '#')
      {
        position = 0;
        LockedPosition(true);
      }
      if (key == password[position])
      {
        position ++;
      }
      if (position == 3)
      {
        LockedPosition(false);
      }
      delay(100);
    }

    void LockedPosition(int locked)
    {
      if (locked)
      {
        digitalWrite(R, HIGH);
        digitalWrite(G, LOW);
        position=0;
      }
      else
      {
        digitalWrite(R, LOW);
        digitalWrite(G, HIGH);
        tmrpcm.setVolume(6);
        tmrpcm.play("matt.wav"); ;
        delay(10000);
        digitalWrite(G,LOW);
      }
    }

body: You have the part checking if the key equals the position in the password and if so you increment the position.  But if it is not equal then you don't do anything.  You should probably have an else there that resets the position to 0 and tells the user they entered the wrong password.


body:
Define two Strings:

    String password = "123";
    String answer = "";

replace the loop function with:

    void loop()
    {
            char key = keypad.getKey(); // init. variable key keypad is non blocking
            while(key == NO_KEY)                 // we got no key press? -> do again
            {
                    key = keypad.getKey();
                    delay(100);
            }
            answer.concat(key);         //add key to answer
            if(answer.equals(password)) //password OK
            {
                    LockedPosition(false);
                    answer="";
            }
            else
            {
                    LockedPosition(true);
            }

            if (answer.length() > password.length()) { // answer is different and bigger than password
                                                       // can't become the right answer
                    answer = "";
            }

            if (key == '*' || key == '#')
            {
                    LockedPosition(true);
                    answer="";
            }

    }

That should do the job.


message:
Arduino not working on external power supply

First of all, my Arduino Uno R3 isn't genuine.

At some moment when I was playing with it, the Arduino stopped working. It was connected to a external 12V power supply on the 2.1mm plug. A single digital output was connected to a base of a BJT, which was being used as a switch. I checked all the voltage differences and amount of current around the BJT with my multimeter, and I made sure nothing ever exceeds the maximum rating.

One thing, I had a jumper wire connected to the 5V, and it might have accidentally got shorted with GND while poking around.

Currently, the Arduino won't start up when given external power supply soley, be it a 2.1mm plug or VIN pin. The ON light is not on. I tried to measure the current it consumes, but the value from the multimeter changes when I switch the measure range -- I suppose this is because the current is so small that the so-small resistance of the multimeter affects the current. The 5V pin, when connected to GND through a 1K ohm resistor, says about 50 mV.

However, when the USB is connected, the board works alright, regardless of whether external power supply is connected. The 5V pin says quite 5V, but I see from the [schematic of Uno Rev. 3](https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf) that it is in fact just pulled from the USB power line, so it **does not** mean that the internal transformer circuitry is alright. When the USB gets disconnected while the USB and the external power supply is both connected, the board immediately turns off.

Am I good to regard this board as dead in some way? What do you think is broken?

And could there be any way to resusticate it?

body: By shorting 5V to GND you have blown the 5V regulator on the board. Buy a new board unless you like reworking SMD components.


body:
You probably have shorted 5V to the Ground and it broke the voltage regulator on the Arduino. You should by a new one. [Original][1] one have more security than non genuine and they are not expensive.

  [1]: https://store.arduino.cc/arduino-uno-rev3


message:
How to set PID parameter Kp, Ki and Kd?

Right now, I'm working with Peltier module using PID algorithm. I search out on the Internet about this and so I found that there are three parameters Kp, Ki and Kd. And everyone uses the different value for that. So, they actually calibrate that value but I don't understand how?

I just use default value like Kp = 2, Ki = 5 and Kd = 1.

And here I take Input as Temperature. My normal temperature is around 25. And now I set my setpoint 20. So, according to the PID algorithm temperature must be reduced to around 20. But still, no change in temperature and my PWM is still 0.

Below is my code:

    #include <PID_v1.h>
    #include "Adafruit_MAX31855.h"

    int thermoDO = 3;
    int thermoCS = 4;
    int thermoCLK = 5;
    Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);

    #define PIN_OUTPUT 6

    //Define Variables we'll be connecting to
    double Setpoint, Input, Output;

    //Specify the links and initial tuning parameters
    double Kp = 2, Ki = 5, Kd = 1;
    PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);

    int IN1 = 8;
    int IN2 = 9;

    void setup()
    {
      Serial.begin(9600);

      //initialize the variables we're linked to
      Input = thermocouple.readCelsius();
      Setpoint = 20;

      //turn the PID on
      myPID.SetMode(AUTOMATIC);

      pinMode(IN1, OUTPUT);
      pinMode(IN2, OUTPUT);
    }

    void loop()
    {
      Input = thermocouple.readCelsius();
      myPID.Compute();
      analogWrite(PIN_OUTPUT, Output);

      digitalWrite(IN1, HIGH);
      digitalWrite(IN2, LOW);

      Serial.print("Setpoint: ");
      Serial.print(Setpoint);
      Serial.print("\t");
      Serial.print("Input: ");
      Serial.print(Input);
      Serial.print("\t");
      Serial.print("Output: ");
      Serial.print(Output);
      Serial.print("\t");
      Serial.print("Kp: ");
      Serial.print(myPID.GetKp());
      Serial.print("\t");
      Serial.print("Ki: ");
      Serial.print(myPID.GetKi());
      Serial.print("\t");
      Serial.print("Kd: ");
      Serial.print(myPID.GetKd());
      Serial.print("\n");
    }

And my output is like:

    Setpoint: 20.00 Input: 24.50 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.50 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.50 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.50 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.50 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.50 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.50 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 24.75 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.00 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.50 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00
    Setpoint: 20.00 Input: 25.25 Output: 0.00 Kp: 2.00 Ki: 5.00 Kd: 1.00

Now here I use MAX31855 module for measuring the temperature which takes as Input here.

**MAX31855 Module:**

[![MAX31855][1]][1]

I think that may be my Kp, Ki and Kd are not perfect for my system. So, maybe this cause problem means not the proper value of Kp, Ki, and Kd. Can anyone give some suggestion how to set this value of Kp, Ki, and Kd? Or there is something else which caused the problem for that. Suggest me.

And here I'm using DC motor driver(20A) for driving the Peltier Module.

  [1]: https://i.stack.imgur.com/vpN1T.jpg

body:
PID algorithms basically change the output to approach the setpoint. Now in your case you have a setpoint of 20 and an input of 24.5. Thus the algorithm thinks it needs to turn the output off so it can "cool down". This would work for a heater.

However since your output is a cooler you need to specify "REVERSE" rather than "DIRECT". This tells the PID module that the output needs to be higher if the input is higher than the setpoint.


message:
Lowest voltage applicable on AREF pin on Uno and Mega

I need to measure an Analog signal in the range of 5-30 mV.

Naturally, using the internal default 5V reference leads to very poor measurement resolution. I would like to use the capability to use an external reference voltage of 50mV on the AREF pin (using an Agilent precision power supply)

However, when I tried this in the lab, I noticed something strange. The ADC readout on the channel remained stuck at 1023. If I used anything above 0.5V on the AREF pin, the readout on the ADC is correct, and the counts reliably go up and down when I ramp up and down the Analog input accordingly.

Any idea how to resolve my issue?

body: According to [the datasheet](http://www.atmel.com/Images/Atmel-42735-8-bit-AVR-Microcontroller-ATmega328-328P_Datasheet.pdf) (page 375) the minimum voltage you are allowed to have as a reference voltage for the ADC is 1V.


body:
In the Arduino Mega it's possible to use differential mode between two analog pins with `10x` gain (or `200x`). But, the resolution is halved (`-512` ... `511`) as it's possible to measure negative difference. But with some precision voltage reference switching and `200x` gain you might be able to archieve some precision.

The downside is those `ADC` channels are not supported by `analogRead`, you have to do it directly by setting `ADMUX` register (or `ADMUX` and `ADCSRB`) to desired differential channel with gain.

    byte backup = ADMUX; // store the arduino settings
    ADMUX = _BV(REFS1) | _BV(MUX3) | _BV(MUX0); // internal 1.1V reference, differential: ADC1+ ADC0-, gain: 10x

    // there should be some delay to stabilize the voltage reference (if another one was selected)
    // but it's possible to preset it by  analogReference(INTERNAL1V1); in the setup() so no delay will be needed

    ADCSRA |= _BV(ADSC);  // start conversion

    while ((ADCSRA & _BV(ADSC)) != 0);  // wait for conversion end (ADSC is cleared after the end by hardware)

    int val = ADC; // read the result
    ADMUX = backup; // restore original settings (from arduino)

In the Arduino everything else in ADC is configured and ADC is started, so just necessary changes are here. It should be working but I didn't tested it (I don't have the Arduino Mega here)


message:
Adafruit Huzzah and SD card breakout

I have an
[Adafruit MicroSD card breakout board][1] and an [Adafruit Feather HUZZAH with ESP8266 WiFi][2]
I wired that up according to [this link's last picture][3].
The code I am using:

    #include <SPI.h>
    #include <SD.h>
    ...
    const int chipSelect = 15;
    ...
    Serial.print("Initializing SD card...");
    pinMode(SS, OUTPUT);

    if (!SD.begin(chipSelect)) {
         Serial.println("initialization failed!");
         return;
     }
    Serial.println("initialization done.");
    ...
I always get the message "initialization failed", I also tried to format my SD card to be sure to have fat32 file system on it, but had no success with that.
What can I do to debug this error further?

TIA

  [1]: https://www.adafruit.com/product/254
  [2]: https://www.adafruit.com/product/2821
  [3]: https://learn.adafruit.com/micropython-hardware-sd-cards/hardware

body:
From experience, I know the following

- Using two SPI devices sometimes does not work, especially with fake SD breakout cards. Not sure about an Adafruit, but try to use only one SPI device at the same time (to check if it works better). For my project (initial setup), I had to use a SD logger extension board instead.
- Sometimes it depends on the SD card which will work. Try to use older non SDHC/XDHC cards (smaller storage normally).
- Use the most simple (and preferably example circuit) to test each component separately (thus your SD breakout card) before adding others (like the WIFI component). This rules out there is no problem with other components working at the same time.


message:
easy_install pip on Arduino Yun fails

I want to install `pip` on the Yún which is running __Linino OS__ but every time I execute the standard steps for `opkg` i.e.

    # opkg update
    # opkg install distribute
    # okpg install python-openssl
    # easy_install pip
**Error**

    Searching for pip
    Reading http://pypi.python.org/simple/pip/
    Couldn't find index page for 'pip' (maybe misspelled?)
    Scanning index of all packages (this may take a while)
    Reading http://pypi.python.org/simple/
    No local packages or download links found for pip
    error: Could not find suitable distribution for Requirement.parse('pip')

What is the reason behind this?

**Kernel Information**

    Linux Arduino 3.3.8 #1 Fri Nov 14 08:57:34 CET 2014 mips GNU/Linux

body:
Try:

    sudo wget https://pypi.python.org/simple/pip/pip-6.0.8.tar.gz
    sudo tar xzvf pip-6.0.8.tar.gz
    cd pip-6.0.8
    python setup.py


body:
Found [this Arduino Forum Thread](http://forum.arduino.cc/index.php?topic=305052.0) helpful.

    # wget \
    https://pypi.python.org/packages/source/p/pip/pip-6.0.8.tar.gz#md5=2332e6f97e75ded3bddde0ced01dbda3\
      --no-check-certificate
    # easy_install pip-6.0.8.tar.gz

Apparently the [PyPi Package Site](https://pypi.python.org) is now __HTTPS__ and hence `--no-check-certificate` option should be used. Also __MD5 Checksum__ of the package needs to attached in the link in order to avoid a __HTTP 404 Error__


message:
I2C LCD Serial Interface Board not displaying text

The code dont gives error, but not displays "Hello World"

    #include <Wire.h>
    #include <LiquidCrystal_I2C.h>

    // Set the LCD address to 0x27 for a 16 chars and 2 line display
    LiquidCrystal_I2C lcd(0x27, 16, 2);

    void setup() {
      // initialize the LCD
      lcd.begin();
      // Turn on the blacklight and print a message.
      lcd.backlight();
      lcd.print("Hello, world!");
    }

    void loop() {
    }

body:
This can be due a lot of reasons, among:

Most common:

- Backlight is set too low (there should be a small dial)
- Circuit problem (recheck), and post it.
- The I2C address is wrong, there are sketches to check it.

Less common:

- Broken LCD
- Broken Arduino
- No power on Arduino (check LED)


message:
Can this work as a waterproofing method?

Im making my garden automated with temperature, humidity and soil temperature sensors. I want to be able to connect my Arduino Uno to a solar panel and keep it outside at all times. I dont want to have to remove it to water the plants. Could I cover it in clear nail polish to water proof it?

body:
Nail polish would work in general as a fair **conformal coating**. However, conformal coatings are not generally intended as waterproofing, but moisture or humidity resistance.

If you product is going to be regularly submerged or deluged with water, you are better off using a waterproof enclosure with a good watertight gland around the cable entrance.


message:
Arduino Nano and SIM800L on Battery Power

I'm very new to Arduino and everything related but I'm highly interested to learn more. However, I've run into a problem right in the beginning.

I want to build some sort of portable emergency/notification button. One pushes the button and an SMS is sent or an HTTP call made to a server. I want to base this project on the Arduino Nano as it's quite small and therefore easily transportable. To have GSM/GPRS connectivity I found the SIM800L which seems quite suitable to what I have in mind. Now to the big question, how to power the Arduino Nano as well as the SIM800L on an portable power source, preferrably only one power source.
From my understanding, the SIM800L requires a peak current of 2A when doing handshakes and sending signals. Is there any way I can power the SIM800L through the Arduino Nano, like Battery -> Arduino Nano -> SIM800L, or do I need to connect both the Arduino Nano and the SIM800L to the battery?
Regarding the lifespan, for now it would be sufficient if I could press the button a few times and afterwards it'd stop working.

body:
Check out
> https://arduino.stackexchange.com/questions/9500/thin-battery-to-power-arduino-micro-with-nrf8001?rq=1

Also, I found a 6v battery (A544) at Menards that is about the same diameter as a AA, but is considerably shorter. It has 178 mAh capacity.

I haven't taken the time to test it, but I would guess it wouldn't have as much of a temperature issue.

It's not as small as the CR2032 in the above mentioned link, nor is it flat, but it's an option.

You might consider an Arduino Beetle. They are really super incredibly tiny and still 16mHz. I can't get any more info from where I'm at, but I'd believe they would use even less power than a Nano/Micro.

I found an Instructable that shows how to use a Beetle, a rechargeable 3.7v LiPo battery, and an HC-06 Bluetooth module. Sounds like it's equivalent to what you're looking for.

http://www.instructables.com/id/Beetle-Minimize-Your-Arduino-Projects/


body:
I did use a big electrolytic polarized capacitor in parallel with the sim800l power pins (like 470uF 16v) on an uno.
It will handle the power on peak :)


body: When you are using a Arduino nano for your project you wont be able get the 2A current draw form the board.You have to use a external power source like a battery.You have to find a better battery with a considerable Ahs.