Pages: [1] 2   Go Down
Author Topic: Noob asks WHY????  (Read 1327 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My friends all tell me I am a smart guy, but damn I feel dumb right now...  First let me say that I am just a NOOB and am struggling with understanding programming an Arduino.  Forgive my frustration please.  I am trying to build an automation system for a diesel generator I am building- I want to start simple and hand a running engine to the Arduino and have it simply watch sensors to control cooling and shut down if overtemp or oil pressure drops.  I have declared my pins globally at the beginning of the sketch, but when I verify it, it tells me '... not declared in this scope'.  WTF?  If its declared globally,  isn't it declared for EVERY scope?  What am I doing wrong?  Yes I checked spelling errors first, I checked against other sample sketches and cannot figure it out...    Anyone wanna get paid to mentor me?
« Last Edit: February 25, 2013, 11:39:33 pm by Eric_Maki » Logged

Ontario
Offline Offline
God Member
*****
Karma: 25
Posts: 888
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It would help a great deal to see your sketch and to see the actual error message you are receiving.  Without the details, it will be hard to give any really useful advise on this.
Logged

California
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3441
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Without any actual code, all we can offer is shots in the dark...

Did you check the case?

myPin

is different than

mypin
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 502
Posts: 19080
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How to use this forum


Read this before posting a programming question
Logged


Des Moines, WA - USA
Offline Offline
God Member
*****
Karma: 25
Posts: 779
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ouch!  DangIt Arrch don't do that!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@ Nick- sorry- I read that stuff, but I couldn't find what you are trying to tell me.  I guess I screwed up somehow here.  I'll just try to figure it out myself then and not bother you all anymore... oh well.  Thanks anyway...
Logged

Rome, Italy
Offline Offline
Sr. Member
****
Karma: 20
Posts: 442
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have declared my pins globally at the beginning of the sketch, but when I verify it, it tells me '... not declared in this scope'.

What people are telling you is that if you want to know about the cause of an error you need to post the code that causes the error. The most likely cause is a typo somewhere and the compiler tells you which line contains the error, but we can only guess.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 502
Posts: 19080
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@ Nick- sorry- I read that stuff, but I couldn't find what you are trying to tell me.

See reply #1.

How can we help you with your code if you don't post it? How can we help with the error message if you don't post that?
Logged


California
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3441
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@ Nick- sorry- I read that stuff, but I couldn't find what you are trying to tell me.  I guess I screwed up somehow here.  I'll just try to figure it out myself then and not bother you all anymore... oh well.  Thanks anyway...

Well with that attitude, I can't imagine why people aren't jumping to giving you the answer.  smiley-roll
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 502
Posts: 19080
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@ Nick- sorry- I read that stuff, but I couldn't find what you are trying to tell me. 

For one thing it said:

Quote
Examples of unhelpful subject lines:

*    Noob here, help needed

Your "Noob asks WHY????" is an example of an unhelpful subject.

Then, did you really, really, read this bit?

Quote
11. Tips for getting the most out of your post


    Mention which Arduino you have. Is it a Uno? Leonardo? Due? Mini? Mega? The problem might be specific to a certain model.
...
    Post a complete sketch (program code)! If you don't you waste time while people ask you to do that. However, with coding problems, if possible post a "minimal" sketch that demonstrates the problem - not hundreds of lines of code. If the problem goes away in the minimal sketch, it wasn't where you thought it was.
...
    If you get an error, post the error (copy and paste). Not just "I got an error".

You didn't post your code, mention what Arduino you have or post your error message. We aren't trying to attack you, but you aren't trying to help us to help you.
Logged


Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Its actually a shame he gave up, I would like to have seen what the cause of the problem was.....
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Offline Offline
Faraday Member
**
Karma: 62
Posts: 3080
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't feed the trolls.
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Forget trolls,     
Quote
  If its declared globally,  isn't it declared for EVERY scope?
    is this true or not?
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

0
Offline Offline
Sr. Member
****
Karma: 8
Posts: 291
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Forget trolls,     
Quote
  If its declared globally,  isn't it declared for EVERY scope?
    is this true or not?

If a variable is defined outside of all code block (context) then yes, you can retrieve and set it from any code block (global).

Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thats why I was curious ...
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Pages: [1] 2   Go Up
Jump to: