Error: 'Pinmode' was not declared in this scope

Hello friends,

I've been having problems getting started with my first program.

The simple code is as follows:

const int transistorpin = 9 ;//connected to base of transistor
const int switchpin = 2 ; //connected to switch

void setup() 
{
Pinmode(switchpin,INPUT); // set the switch pin as input
Pinmode(transistorpin, OUTPUT); //Set the transistorpin as output
}


void loop() {
If (digitalRead(switchpin)==HIGH) // If switch is on (HIGH)..
{
  digitalwrite(transistorpin, HIGH);//Turn motor on high
}
else if (digitalread(switchpin)==LOW) // If Switch is off (LOW)..
{
  digitalwrite(transistorpin, LOW); //Turn Motor off
}

}

The error message I get, for starters is "error: 'Pinmode' was not declared in this scope"

Other programs from examples etc are working fine.

Kindly help

Thanks!!

Warm regards,

Steve

Perhaps because "Pinmode" doesn't exist? "pinMode" does exist....

Regards,
Ray L.

"If" also doesn't exist.
Hint:

If (digitalRead(switchpin)==HIGH) // If switch is on (HIGH)..
{
  digitalwrite(transistorpin, HIGH);//Turn motor on high
}
else if (digitalread(switchpin)==LOW) // If Switch is off (LOW)..
{
  digitalwrite(transistorpin, LOW); //Turn Motor off
}

can be shortened (and corrected) to digitalWrite(transistorpin, digitalRead(switchpin));

C++ is case-sensitive, so you have to get the capitalisation of everything correct. Pinmode is not the same as pinMode.

Thanks everyone for your kind inputs. Was unaware that C++ was case sensitive. This being my first program, did try typing it myself, so that I can get the depth and proper syntax.

Thanks again arduinodlb, AWOL and RayLivingston

rebelsteve:
Thanks everyone for your kind inputs. Was unaware that C++ was case sensitive. This being my first program, did try typing it myself, so that I can get the depth and proper syntax.

Thanks again arduinodlb, AWOL and RayLivingston

Congratulations on typing it yourself to get a deeper understanding. If only more people would do that.

thanks for the information, this has put me right as well, i was typing pinmode and when i change it to pinMode all worked fine.