Pages: [1]   Go Down
Author Topic: "was not declated in this scope" error on Blink, newbie stuck - help please  (Read 1021 times)
0 Members and 1 Guest are viewing this topic.
Yorkshire, England, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there, I'm afraid its another silly newbie problem I'm looking for some help with please.
I received my new Arduino Duemilanove ATmega 328 p & followed the setup as per instruction on this site after downloading the Windows software ( Arduino 0022, I'm running it on XP Professional Sp3 ).
Drivers installed no problem.
It automatically set up the serial USB onto port 11, so as in instructions I changed this to a lower port (port 1).

After selecting the correct board & port in tools tab of the software then loading "Blink" from File, sketchbook, basics - my problem is this...

If I try & upload to the board or if I run the sketch, some error messages appear.

The board has a blue power led on and a yellow "L" led constantly flickering as soon as usb is connected - this does not change whilst attempting to upload ie no Rx/Tx led's.

The error shown is cut & pasted as follows:-

Blink.cpp:8:22: error: WProgram.h: No such file or directory
Blink.cpp: In function 'void setup()':
Blink:10: error: 'OUTPUT' was not declared in this scope
Blink:10: error: 'pinMode' was not declared in this scope
Blink.cpp: In function 'void loop()':
Blink:14: error: 'HIGH' was not declared in this scope
Blink:14: error: 'digitalWrite' was not declared in this scope
Blink:15: error: 'delay' was not declared in this scope
Blink:16: error: 'LOW' was not declared in this scope

Also tried this on my laptop (XP Sp3) with same results.

Any help here would be greatly appreciated.

Kind regards, Matthew
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 64
Posts: 6055
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It would be helpful if you posted the code you are trying to compile.  (Just saying "I was using the example" can be misleading.  You'd be surprised what small things can mess the process up.)

When posting code, please use the code brackets or the "#" button in the post editor.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 444
Posts: 23861
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"WProgram.h" you probably need to copy this file into your local arduino storage area.
The rest sounds like missing ; or) or } somewhere.
Really need to see your code listing as James said.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This sounds to me like an error in downloading/extracting.

I presume you downloaded, extracted and then copied the whole folder somewhere then when running the software encountered this error.

What extractor did you use?
Logged

Yorkshire, England, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thankyou all for your help.
You have hit the nail on the head, problem solved!

As I am unable to get an internet connection at home on my pc, I downloaded the zip file on my Android smartpone.
Somehow some files have gone missing when extracting.

I have extracted from the zip file again and hey-presto it worked straight away!

Just need to find a practical use for this board now.

Sorry to trouble you guys with this problem, I'm very grateful for your help.

Thankyou!!
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Sorry to trouble you guys with this problem, I'm very grateful for your help.
No worries, the problem comes up now and again - thankfully it is normally an easy one to solve.
Logged

Pages: [1]   Go Up
Jump to: