Writing program HELP

Hi
i am new to the arduino world i am trying to learn the code. i was writing a very simple code i get this error.

In function 'void setup()':
error: 'pinmode' was not declared in this scope In function 'void loop()':

when i type this code.

//this is my first program so this is a try

int ledpin = 5;

void setup() {
  pinmode(ledpin, OUTPUT);
} 

void loop () {
  digitalwrite(ledpin, HIGH);
  delay(10000);
  digitalwrite(ledpin, LOW);
  delay(5000);
}

some one please help me.

pinMode needs a capital M
edit: digitalWrite needs a capital W

It should be pinMode() with a capital M.

digitalWrite() needs a capital W.

In programming these little syntax mistakes make or break the code. Coding is very case sensitive.

Hah, Mike appeared while I was editing. sorry :wink:

We both where typing our post at the same time it seams. You just posted a little before me.

ok i will try that. Thank you so much!!!

Hey i have another problem. i get this error

 In function 'void setup()':
error: expected initializer before 'digitalWrite'

when i type this code:

//this is my first program so this is a try

int ledpin = 5; // red led pin
int greled = 6; // Green led pin

void setup() {
  pinMode(ledpin, OUTPUT);// makes pin 5 a output
  pinMode(greled, OUTPUT);// makes pin 6 a output
  {

void loop () 
  digitalWrite(ledpin, HIGH);//turns red led on for 1 sec
  delay(1000);
  digitalWrite(ledpin, LOW);//turns red led off for 1 sec
  delay(1000);
  digitalWrite(greled, HIGH);//turns green led on for 1 sec
  delay(1000);
  digitalWrite(greled, LOW);//turns green led on for 1 sec
  delay(1000);
}

It's all in those pesty details. :wink:

//this is my first program so this is a try

int ledpin = 5; // red led pin
int greled = 6; // Green led pin

void setup() {
  pinMode(ledpin, OUTPUT);// makes pin 5 a output
  pinMode(greled, OUTPUT);// makes pin 6 a output
  }   // one error was here, you had a opening brace character

void loop () {  // another error was here, you were missing the
                     // opening brace character
  digitalWrite(ledpin, HIGH);//turns red led on for 1 sec
  delay(1000);
  digitalWrite(ledpin, LOW);//turns red led off for 1 sec
  delay(1000);
  digitalWrite(greled, HIGH);//turns green led on for 1 sec
  delay(1000);
  digitalWrite(greled, LOW);//turns green led on for 1 sec
  delay(1000);
}

Lefty

void setup() {
  pinMode(ledpin, OUTPUT);// makes pin 5 a output
  pinMode(greled, OUTPUT);// makes pin 6 a output
  {

should be:

void setup() {
  pinMode(ledpin, OUTPUT);// makes pin 5 a output
  pinMode(greled, OUTPUT);// makes pin 6 a output
[glow] }
[/glow]

The { was defining the start of a block of code, the first line of which was void loop(), which is not valid in that context. So, the error message, which most likely means nothing to you.

Thanks so much that fixed it all. all those pesky little curley things ;D

And the damned keyboards that keep introducing errors in our code. :wink:

ya

do you know of any good arduino tutorials. like code and all that other stuff. i book would be nice. i need something that is ment for someone with no base. Thanks

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1247637768

This is a pretty darn good intro. Any C book will provide good information, too.

a thanks i found that one i like it i was looking for another one two

Well there's this: http://arduino.cc/en/Tutorial/Sketch and this: Arduino Tutorial - Learn electronics and microcontrollers using Arduino!

Andrew