ATTINY85 Uploading own sketch, 2 pins needed

Hello everyone! I am trying to run a sketch that uses a 9 LED ledstrip, as well as a mini pushbutton switch (as an on/off button). I need the ATTINY85, because my set up has to be very small.

I am using Arduino 1.8.8 and found several tutorials on how to program the ATTINY85 with the Arduino Uno. This I managed to do and tested with the blink. Beyond that, I find it difficult to find tutorials that describe how to upload your own code, also when it involves several pins.

My logic follows that I can just upload it to the ATTINY85 in the basic setup and then set up the independent circuit. I am planning to use How to wire Mini Pushbutton Switch, RGB LED Strip - Addressable to ATTiny85 IC for that.

When I now try to upload I get the infamous ‘exit status 1’ error message.

My code is as follows:

#include <Button.h>

    #include <FastLED.h>
    #define NUM_LEDS 9
    #define DATA_PIN PB0
    #define LED_PIN PB0
    #define BRIGHTNESS  64
    #define LED_TYPE    WS2812B
    #define COLOR_ORDER GRB 

        CRGB leds[NUM_LEDS];  

        int inPin =  PB1;         // the number of the input pin
int outPin = PB2;       // the number of the output pin

int state = HIGH;      // the current state of the output pin
int reading;           // the current reading from the input pin
int previous = LOW;    // the previous reading from the input pin

// the follow variables are long's because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long time = 0;         // the last time the output pin was toggled
long debounce = 200;   // the debounce time, increase if the output flickers

   void setup() { 
       FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);

        delay( 3000 ); // power-up safety delay
  FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
  FastLED.setBrightness(  BRIGHTNESS );

      pinMode(inPin, INPUT);
  pinMode(outPin, OUTPUT);


       void loop() { 

  reading = digitalRead(inPin);

  // if the input just went from LOW and HIGH and we've waited long enough
  // to ignore any noise on the circuit, toggle the output pin and remember
  // the time
  if (reading == HIGH && previous == LOW && millis() - time > debounce) {
    if (state == HIGH)
      state = LOW;
      state = HIGH;

    time = millis();    

  digitalWrite(outPin, state);

  previous = reading;

        leds[0] = CRGB::Green;; 

        leds[1] = CRGB::Green;; 

        leds[2] = CRGB::Green;; 
        leds[3] = CRGB::Green;; 

        leds[4] = CRGB::Green;; 

        leds[5] = CRGB::Green;; 

        leds[6] = CRGB::Green;; 

        leds[7] = CRGB::Green;; 

        leds[8] = CRGB::Green;; 

  for (int i = 0; i < 9; i++) {
    leds[i] = CRGB::Green;;
    leds[i] = CRGB::Black;



  int wait=random(10,30);
  int dim=random(4,6);
  int max_cycles=8;
  int cycles=random(1,max_cycles+1);

  rainbowCycle(wait, cycles, dim);

void rainbowCycle(int wait, int cycles, int dim) {

  //loop several times with same configurations and same delay
  for(int cycle=0; cycle < cycles; cycle++){

    byte dir=random(0,2);
    int k=255;

    //loop through all colors in the wheel
    for (int j=0; j < 256; j++,k--) { 

      if(k<0) {

      //Set RGB color of each LED
      for(int i=0; i<NUM_LEDS; i++) {

        CRGB ledColor = wheel(((i * 256 / NUM_LEDS) + (dir==0?j:k)) % 256,dim);        



CRGB wheel(int WheelPos, int dim) {
  CRGB color;
  if (85 > WheelPos) {
   color.g=WheelPos * 3/dim;
   color.b=(255 - WheelPos * 3)/dim;;
  else if (170 > WheelPos) {
   color.r=WheelPos * 3/dim;
   color.g=(255 - WheelPos * 3)/dim;
  else {
   color.r=(255 - WheelPos * 3)/dim;
   color.b=WheelPos * 3/dim;
  return color;



Now to my two main questions:

  1. In which circuit set-up do I best install my sketch?
  2. Which pins do I put into my sketch, the ones that are connected to the Arduino Uno right now or according to the ATTiny85 schematic?

I am grateful for direct troubleshooting and hints, as well as general resources that would help! Thank you.

When I now try to upload I get the infamous 'exit status 1' error message.

Exit status 1 only means that something went wrong. There are a near infinite number of possible causes. You need to scroll the black console window at the bottom of the Arduino IDE window up and read the specific compiler errors that caused the exit status 1. Those will tell you what is wrong with your code.


  1. In which circuit set-up do I best install my sketch?

I don't understand the question. Please explain yourself in more detail.

2) Which pins do I put into my sketch, the ones that are connected to the Arduino Uno right now or according to the ATTiny85 schematic?

Whichever pins you want your sketch to act upon.

Hey your reply helped me- thank you! I scrolled up and the clock was too low, changed it to 8Mhz and uploading was no problem, but no LEDs that turned on...

I have an updated post ATTINY85 LED strip + push button - Microcontrollers - Arduino Forum, I would really appreciate if you could check it out. Thank you!