Code help? Buttons?

My code, there are no errors. I removed a majority of the code just for the purposes of it fitting in here, however, I didn't remove anything important. The blinker is stuck on Left Blinker. It's either my code, or wiring.

const int buttonLeft = 1;
const int buttonRight = 0;
const int buzzer = 19;
//SPEED OF BLINK
int speedx = 50;

void setup()
{
pinMode(buttonLeft, INPUT);
pinMode(buttonRight, INPUT);
pinMode(buzzer, OUTPUT);
}

void left_Blinker()
{
//code
}

void right_Blinker()
{
//code
}

int button1;
int button2;

void loop()
{
int i;
button1 = digitalRead(buttonLeft);
button2 = digitalRead(buttonRight);
if(button1 == HIGH)
{
left_Blinker();
}
else if(button2 == HIGH)
{
right_Blinker();
}
else if(button2 == HIGH && button1 == HIGH)
{
digitalWrite(buzzer, HIGH);
delay(65);
digitalWrite(buzzer, LOW);
delay(65);
}
else
{
digitalWrite(buzzer, LOW);
}
}

I don't see how those buttons are going to do anything; since you're not using the internal pull-up resistors, there should be 3 connections to the button: input pin, resistor to ground/vcc, vcc/ground depending on where the resistor goes to.

Arrch:
I don't see how those buttons are going to do anything.

Explain please.

tylerv:

Arrch:
I don't see how those buttons are going to do anything.

Explain please.

Edited my post. It would be easier, though, to just remove the resistor, enable the internal pullups, and connect one of the right side pins to the input pin and one of the left side pins to GND.

Still doesn't work. I'm new to Arduino, so it might take a little more explaining.

See my latest reply.

Arrch:

tylerv:

Arrch:
I don't see how those buttons are going to do anything.

Explain please.

Edited my post. It would be easier, though, to just remove the resistor, enable the internal pullups, and connect one of the right side pins to the input pin and one of the left side pins to GND.

I don't understand..? What's an internal pullup? So I tried this, but the right blinker keeps going until I press the left button, then it goes left. I release the left button and it goes right again. Why is this?

tylerv:
I don't understand..? What's an internal pullup? So I tried this, but the right blinker keeps going until I press the left button, then it goes left. I release the left button and it goes right again. Why is this?

http://lmgtfy.com/?q=arduino+internal+pullup

Read this article: http://arduino.cc/en/Tutorial/DigitalPins

I added this to the loop before the if:

digitalWrite(buttonLeft, LOW);
digitalWrite(buttonRight, LOW);

Nothing has changed.

I discovered that button2 infinitely = HIGH. Is something here defective? When I commented out the right_Blinker(); the left blinker would work if I just touch it. Something's wrong with the right side.

Don't use pins 0 or 1 they are used for serial. Move your switches to 2 and 3. I also recommend using the internal pullup resistors. You have no debouncing strategy.

Use the internal pull-up resistors. If you have Arduino IDE 1.0 or newer, it should be like this:

void setup()
{
  pinMode(buttonLeft, INPUT_PULLUP);
  pinMode(buttonRight, INPUT_PULLUP);
  pinMode(buzzer, OUTPUT);
}

Remove all the external resisters to your buttons, and connect one side of the button to GND and the other side to the input pin. Now, when you press the button, the input pin should read "LOW". Change your code as needed.

P.S. Use code tags!

I'll try this next time. Actually just changing port 0 to a different port fixed the problem.

tylerv:
Read this article: http://arduino.cc/en/Tutorial/DigitalPins

That gives no indication that this code:

  digitalWrite(buttonLeft, LOW);
  digitalWrite(buttonRight, LOW);

should work. So when you say

Nothing has changed.

I'm not surprised.