11018Views10Replies

Author Options:

Whenever I use arduino IDE this weird error message appears in the box.? Answered



sketch_mar24a.cpp: In function 'void setup()':
sketch_mar24a:7: error: 'pinmode' was not declared in this scope
sketch_mar24a.cpp: In function 'void loop()':
sketch_mar24a:15: error: 'digitalwrite' was not declared in this scope

What does this mean and how do I fix it.

10 Replies

user
steveastroukBest Answer (author)2011-03-24

You have a syntax error ! An extra character, a missing brace, whatever, but something just above it is screwed up, ever so slightly.

Steve

Select as Best AnswerUndo Best Answer

user
crzy engineer (author)2011-12-18

hey transuranic, I'll answer your debug question by adding comments above
the ares that are missing a thing or two.


#define LED 13

void setup()
{

//on this tid-bit of code, the FUNCTION that allows us to say "pin X your an output!" requires that we capitalize the first letter of the compound word "pinMode", in this case the word is M in pinMode.

pinMode(LED, OUTPT);

}

void loop()
{

//same applies here transuranic, the FUNCTION digitalWrite, the command we give Arduino that turns an LED on or off, requires that we capitalize the second word of the compound word digitalWrite, W.

// oh, and also don't forget to slap in a semicolon at the end of every instruction
(line of code).

digitalWrite(LED, HIGH);
delay(1000);
digitalWrite(LED, LOW);
delay(1000);


}


And that' it, this sketch should run in Arduino with no problems :)


Select as Best AnswerUndo Best Answer

user
coolfolder (author)2011-08-18

debugging and adding my formatting to:

#define LED 13


void setup()
{
pinmode(LED, OUTPUT);




}

void loop()
{
digitalwrite(LED, HIGH)
delay(1000)
digitalwrite(LED, LOW)
delay(1000)

corrected:

int LED = 13;

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

void loop(){
digitalwrite(LED, HIGH);
delay(1000);
digitalwrite(LED, LOW);
delay(1000);
}

Select as Best AnswerUndo Best Answer

user
transuranic (author)2011-03-24

It turns out I didnt capitalize one letter. THANK YOU ALL

Select as Best AnswerUndo Best Answer

user
it hertz (author)transuranic2011-03-27

Thanx that what i was doing wrong so every second word should start with a capital letter pinMode been deleting curlys rewriting the hole script Thanx

Select as Best AnswerUndo Best Answer

user
transuranic (author)2011-03-24

Also, pinmode and digitalwrite do not turn orange in the sketch.

Select as Best AnswerUndo Best Answer

user
astroboy907 (author)transuranic2011-03-25

yeah looks like it got answered but just as a hint most of the functions in arduino (and other code) the proper syntax is to have the second words first letter capitalized... :) GL!

Select as Best AnswerUndo Best Answer

user
transuranic (author)2011-03-24
user
transuranic (author)2011-03-24

can some body de-bug this please!?

#define LED 13


void setup()
{
pinmode(LED, OUTPUT);




}

void loop()
{
digitalwrite(LED, HIGH)
delay(1000)
digitalwrite(LED, LOW)
delay(1000)
}

Select as Best AnswerUndo Best Answer

user
transuranic (author)2011-03-24

something else, When I plug it in and put a LED in pin 13 the LED blinks along with "L" on my duemilanove.

Select as Best AnswerUndo Best Answer