Can I use neopixel with attiny and 3 inputs?

I'm trying to control the NeoPixel with attiny and three inputs.
However, the input terminals "PB2" is working but "PB0" and "PB1" don't work.
I don't know if this is a problem with my code or Attiny can't write more than three inputs.
I want to receive various comments or alternatives.
Thanks.

#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(6, 4, NEO_GRB + NEO_KHZ800);

int delayval = 500; // delay for half a second
const int buttonPin1 = A0; //assigns pushbutton to pin A2 (P2)
const int buttonPin2 = A1;
const int buttonPin3 = A2;
int buttonState1 = 0;
int buttonState2 = 0;
int buttonState3 = 0;

void setup() {
  pinMode(buttonPin1, INPUT_PULLUP);  //sets buttonPin to input
  pinMode(buttonPin2, INPUT_PULLUP);
  pinMode(buttonPin3, INPUT_PULLUP);
  buttonState1 = 0;
  buttonState2 = 0;
  buttonState3 = 0;
}



void loop() {

  buttonState1 = digitalRead(buttonPin1); //read the state of the pushbutton valuse ;;
  buttonState2 = digitalRead(buttonPin2);
  buttonState3 = digitalRead(buttonPin3);
  if (buttonState1 == HIGH) {
    if(buttonState2 == HIGH){
      if(buttonState3 == HIGH){
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(0,0,0));
        }
      }  
      else{  
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(0,0,150));
        }
      }
    }
    else{
      if(buttonState3 == HIGH){
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(0,150,0));
        }
      }
      else{
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(0,150,150));
        }
      }
    }
  }   
  else{
    if(buttonState2 == HIGH){
      if(buttonState3 == HIGH){
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(150,0,0));
        }
      }
      else{
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(150,0,150)); 
        }
      }
    }
    else{
      if(buttonState3 == HIGH){
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(150,150,0));
        }
      }
      else{
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(150,150,150)); 
        }
      }
    }
  }
  pixels.show();
}

I can't upload photos, so I'll leave a link.

I can't upload photos,

Then read How to use this forum
and image guide.
Do not post links to spam infested, cooky pestering sites.

What has that code got to do with your problem? What sort of ATtiny are you using? Beginners often confuse the pin assignments on those chips.

Grumpy_Mike:
What has that code got to do with your problem? What sort of ATtiny are you using? Beginners often confuse the pin assignments on those chips.

First of all, I apologize for putting image link because Koream Army blocked upload of images.

I was planning to implement 8 colors using the atiny85 and 3 switches.
So i connect 3 switches from port PB0 to PB2 and connected neopixel to PB4.
And I started the simulation using the code above and using tinkercad.

however, port PB2 is working but port PB1 and port PB0 doesn't worked.

I don't know where the problem is and want comments to solve this problem.
Thanks.

Grumpy_Mike:
What sort of ATtiny are you using?

Please answer the questions.
Please post code that is your failed attempt to use three outputs to drive three strips.

Grumpy_Mike:
Please answer the questions.
Please post code that is your failed attempt to use three outputs to drive three strips.

I will use attiny85
and I'm planning control one neopixel wtih three switches.

#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(6, 4, NEO_GRB + NEO_KHZ800);

int delayval = 500; // delay for half a second
const int buttonPin1 = A0; //assigns pushbutton to pin A2 (P2)
const int buttonPin2 = A1;
const int buttonPin3 = A2;
int buttonState1 = 0;
int buttonState2 = 0;
int buttonState3 = 0;

void setup() {
  pinMode(buttonPin1, INPUT_PULLUP);  //sets buttonPin to input
  pinMode(buttonPin2, INPUT_PULLUP);
  pinMode(buttonPin3, INPUT_PULLUP);
  buttonState1 = 0;
  buttonState2 = 0;
  buttonState3 = 0;
}



void loop() {

  buttonState1 = digitalRead(buttonPin1); //read the state of the pushbutton valuse ;;
  buttonState2 = digitalRead(buttonPin2);
  buttonState3 = digitalRead(buttonPin3);
  if (buttonState1 == HIGH) {
    if(buttonState2 == HIGH){
      if(buttonState3 == HIGH){
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(0,0,0));
        }
      }  
      else{  
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(0,0,150));
        }
      }
    }
    else{
      if(buttonState3 == HIGH){
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(0,150,0));
        }
      }
      else{
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(0,150,150));
        }
      }
    }
  }   
  else{
    if(buttonState2 == HIGH){
      if(buttonState3 == HIGH){
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(150,0,0));
        }
      }
      else{
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(150,0,150)); 
        }
      }
    }
    else{
      if(buttonState3 == HIGH){
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(150,150,0));
        }
      }
      else{
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(150,150,150)); 
        }
      }
    }
  }
  pixels.show();
}

What physical pins are you using? Can you draw a diagram of how you have connected your circuit showing the physical pin numbers and what you are using them as.

What puzzles me is that I can't find an A4 pin on the ATtiny85.

Also pin 1, or A0 is also the reset pin and so you can't use that as a full push button digital input without changing the fuse bit, and then programming becomes tricky. It can read the analogue value on that pin but only up to a certain level. See this for information on how to use multiple push buttons on a single analogue input and about using the reset pin.

http://www.technoblogy.com/show?LSE

Grumpy_Mike:
What puzzles me is that I can't find an A4 pin on the ATtiny85.

Also pin 1, or A0 is also the reset pin and so you can't use that as a full push button digital input without changing the fuse bit, and then programming becomes tricky.

I read this quote and realized I can't use pin 1, A0 and I found out I was confused with Pin.
So I removed the switch that was connected to the "A0" and "A1" pins and connected it to the other pins, and I could see it working properly.

I am grateful for your advice on this question that has long been hard to understand.
Also, I am gaining a lot of knowledge through this case.

Thanks.

#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(6, 5, NEO_GRB + NEO_KHZ800);

int delayval = 500; // delay for half a second
const int buttonPin1 = A1; //assigns pushbutton to pin A2 (P2)
const int buttonPin2 = A3;
const int buttonPin3 = A2;
int buttonState1 = 0;
int buttonState2 = 0;
int buttonState3 = 0;

void setup() {
  pinMode(buttonPin1, INPUT_PULLUP);  //sets buttonPin to input
  pinMode(buttonPin2, INPUT_PULLUP);
  pinMode(buttonPin3, INPUT_PULLUP);
  buttonState1 = 0;
  buttonState2 = 0;
  buttonState3 = 0;
}



void loop() {

  buttonState1 = digitalRead(buttonPin1); //read the state of the pushbutton valuse ;;
  buttonState2 = digitalRead(buttonPin2);
  buttonState3 = digitalRead(buttonPin3);
  if (buttonState1 == HIGH) {
    if(buttonState2 == HIGH){
      if(buttonState3 == HIGH){
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(0,0,0));
        }
      }  
      else{  
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(0,0,150));
        }
      }
    }
    else{
      if(buttonState3 == HIGH){
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(0,150,0));
        }
      }
      else{
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(0,150,150));
        }
      }
    }
  }   
  else{
    if(buttonState2 == HIGH){
      if(buttonState3 == HIGH){
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(150,0,0));
        }
      }
      else{
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(150,0,150)); 
        }
      }
    }
    else{
      if(buttonState3 == HIGH){
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(150,150,0));
        }
      }
      else{
        for(int i=0; i<6; i++){
          pixels.setPixelColor(i,pixels.Color(150,150,150)); 
        }
      }
    }
  }
  pixels.show();
}

OK so you have now said the Neopixels are driven by pin 5, what hardware pin number is that then?

Grumpy_Mike:
what hardware pin number is that then?

I saw your comment and saw the atiny85 pin map, and I know neopixel is connected to pin1(reset).
But this circuit worked fine.
Is there has anything problem?

I know neopixel is connected to pin1(reset)

OK that is fine.