user82448: I am a beginner to Arduino, and I'm having a problem in a project that I am currently working on.
I was just beginning to write the code, after preparing the components and the wiring, and suddenly two of my buttons never stopped outputting, despite my instructions to only output when the buttons are low, and the other one doesn't do anything at all.
I am using three buttons, one of them is a interruptor switch.
Here is my code:
#include <Adafruit_NeoPixel.h>

#define PIN 3    // input pin Neopixel is attached to
#define NUMPIXELS 28 // number of neopixels in strip

#define TRAVAO 8
#define PISCA 13
#define QUATRO_PISCAS 11

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int redColor = 0;
int greenColor = 0;
int blueColor = 0;

void setup() {
  pixels.begin();
  
  pinMode(TRAVAO, INPUT_PULLUP);
  pinMode(PISCA, INPUT_PULLUP);
  pinMode(QUATRO_PISCAS, INPUT_PULLUP);
  
  Serial.begin(9600);
}

void loop() {
  if(digitalRead(TRAVAO) == LOW) {
    Serial.print("bbb");
  }
  
  if(digitalRead(PISCA) ==  LOW) {
    Serial.print("ccc");
  }
  
  if(digitalRead(QUATRO_PISCAS) ==  LOW) {
    Serial.print("ddd");
  }
  
  delay(1);
}

Here is my arduino:


user10794: Here's your problem:
#define TRAVAO 8

As you can see from your wiring diagram, nothing is connected to pin 8.

82448: <p>I am a beginner to Arduino, and I'm having a problem in a project that I am currently working on.</p>
<p>I was just beginning to write the code, after preparing the components and the wiring, and suddenly two of my buttons never stopped outputting, despite my instructions to only output when the buttons are low, and the other one doesn't do anything at all.</p>
<p>I am using three buttons, one of them is a interruptor switch.</p>
<p>Here is my code:</p>
<pre><code>#include &lt;Adafruit_NeoPixel.h&gt;

#define PIN 3    // input pin Neopixel is attached to
#define NUMPIXELS 28 // number of neopixels in strip

#define TRAVAO 8
#define PISCA 13
#define QUATRO_PISCAS 11

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int redColor = 0;
int greenColor = 0;
int blueColor = 0;

void setup() {
  pixels.begin();
  
  pinMode(TRAVAO, INPUT_PULLUP);
  pinMode(PISCA, INPUT_PULLUP);
  pinMode(QUATRO_PISCAS, INPUT_PULLUP);
  
  Serial.begin(9600);
}

void loop() {
  if(digitalRead(TRAVAO) == LOW) {
    Serial.print(&quot;bbb&quot;);
  }
  
  if(digitalRead(PISCA) ==  LOW) {
    Serial.print(&quot;ccc&quot;);
  }
  
  if(digitalRead(QUATRO_PISCAS) ==  LOW) {
    Serial.print(&quot;ddd&quot;);
  }
  
  delay(1);
}
</code></pre>
<p>Here is my arduino:</p>
<p><a href="https://i.stack.imgur.com/q0YxG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q0YxG.png" alt="enter image description here" /></a></p>
 10794: <p>Here's your problem:</p>
<pre><code>#define TRAVAO 8
</code></pre>
<p>As you can see from your wiring diagram, nothing is connected to pin 8.</p>
