Go Down

Topic: Noob asks WHY???? (Read 1 time) previous topic - next topic

Eric_Maki

Feb 26, 2013, 05:37 am Last Edit: Feb 26, 2013, 05:39 am by Eric_Maki Reason: 1
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?

gardner

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.

Arrch

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

Did you check the case?

myPin

is different than

mypin

Nick Gammon

Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

lloyddean

Ouch!  DangIt Arrch don't do that!

Eric_Maki

@ 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...

spatula


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.

Nick Gammon


@ 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?
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Arrch


@ 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:

Nick Gammon


@ 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.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Boffin1

Its actually a shame he gave up, I would like to have seen what the cause of the problem was.....
With my mobile phone I can call people and talk to them -  how smart can you get ?

michinyon

Don't feed the trolls.

Boffin1

Forget trolls,     
Quote
If its declared globally,  isn't it declared for EVERY scope?
is this true or not?
With my mobile phone I can call people and talk to them -  how smart can you get ?

mistergreen


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).


Boffin1

Thats why I was curious ...
With my mobile phone I can call people and talk to them -  how smart can you get ?

Go Up