Coding problem

I am attempying to write a code so that the Arduino with the assist of a push button will light a led. I keep getting an error " Undefined reference to setup"

This is my second time using this site. Please let me know if I am doing something wrong.

const int buttonPin = 2; // the nember of the push button pin const int ledPin = 13; //the number of the led pin

// variables will change int buttonState = 0; // variable for reading the push button status

void Setup (){ // intailize the LED pin as an output; pinMode(ledPin, OUTPUT); // intialize the pushbutton pin as an input; pinMode(buttonPin, INPUT); }

void loop(){ // read the state of the push button value; buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed; //if it is, the button is high; if (buttonState == HIGH) { //turn LED on; digitalWrite(ledPin, HIGH); } else{ //turn LED off; digitalWrite(ledPin, LOW); } }

Thank You

uncapitalize Setup - use all lower case. C++ is case sensitive, gotta watch those kinds of things.

These don't need to be int's - byte will work just fine: const int buttonPin = 2; // the nember of the push button pin const int ledPin = 13; //the number of the led pin int buttonState = 0;

How is the pin wired? pinMode(buttonPin, INPUT);

Better to use this pinMode(buttonPin, INPUT_PULLUP);

Wire the button to connect the pin to Gnd when pressed, then check for a Low: if (buttonState == LOW) {

Internal pullup resistor keeps the pin HIGH when the button is not pressed.

aqajcs: void loop(){   // read the state of the push button value;   buttonState = digitalRead(buttonPin);     // check if the pushbutton is pressed;   //if it is, the button is high;   if (buttonState == HIGH) {     //turn LED on;     digitalWrite(ledPin, HIGH);   }     else{       //turn LED off;       digitalWrite(ledPin, LOW);     } }

Contracts to:

void loop(){
 digitalWrite(ledPin, digitalRead(buttonPin));
 }