Problem solved! Using hardware that actually works - plus code recommended by the Forum. Thanks again for helping out.
/*
TWO BUTTONS - ONE OUTPUT
Turns on a light emitting diode(LED) when pressing one pushbutton;
and off again when pressing a second button. LED stays on in between.
The circuit:
* LED attached from pin 13 to ground
* pushbuttons attached to pins 2 and 3 with 10k pull-down resistors to ground.
Written 2/1/13 by
Telefondreng.
*/
// constants used to
// set pin numbers:
const int button1 = 2; // the number of the 1st pushbutton pin
const int button2 = 3; // the 2nd
const int ledPin = 13; // the number of the LED pin
void setup()
{
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the 1st pushbutton pin as an input:
pinMode(button1, INPUT);
//initialize 2nd pushbutton
pinMode(button2, INPUT);
digitalWrite (ledPin,LOW);
}
void loop()
{
if ( digitalRead(button1))
{
digitalWrite (ledPin,HIGH);
}
if (digitalRead(button2))
{
digitalWrite(ledPin,LOW);
}
}