I just got my Arduino and made my first sketch which worked as it should. My directions were to us the int command in order to simplify making changes later. When I try this nothing happens, the int does not go orange as it should. I am new to programming so don't know what to do, Can someone help me.
You have not posted any of the context that might explain what you're doing or being asked to do. Without more information, it's not possible to help you.
Where and how did you use this int "command" ?
Please post your program and explain what you tried.
It sounds like you were maybe advised to declare an int variable with a name and value so that the value could be changed later and the change would be reflected throughout the program.
I was following the example of Lesson 1 by Paul McWhorter and had my red LED on and off and able to control times etc, Next he said to use the INT in order to simplify making changes later.
When I do this I get an error message and the INT does not turn Orange as his did.
Error message:"expected unqualified id before numerical constant"
Does this help any
laurielwright:
I was following the example of Lesson 1 by Paul McWhorter and had my red LED on and off and able to control times etc, Next he said to use the INT in order to simplify making changes later.When I do this I get an error message and the INT does not turn Orange as his did.
Error message:"expected unqualified id before numerical constant"
Does this help any
Post your code, buddy. We aren't mind readers.
Please use code tags.
We don't know who the hell Paul McWhorter is, or what his first lesson says, so that doesn't help us one bit...
LaurialWright is this the code you're talking about? I believe this Paul is on Utube.
Delta_G is right, int is not a command but a declaration of type. While I don't agree with Paul's naming convention of LEDPin, the code does work. I believe he tells you in the video to play with the example and see what you can make it do. Do that by typing his example into the Arduino program interface verbatim and see what it does. Then play with it after it's working by changing the waitTimeOn and waitTimeOff numbers.
Being new to programming is confusing at first. I find C++(the language you're using) one of the harder languages to get used to. Don't get discouraged.
With reading, practice, experimenting (As Paul says in his video) and perserverance, you'll learn this over time. Any programming language is massive, and it takes quite some time to learn, especially if you've never done any type of programming in the past.
There is tons of information on the Arduino site where you can get answers without even posting in the forums. Start under the learning menu and look at the tutorials there. There are also many examples that came down with the Arduino software available under the file menu. You can use them directly without having to type them from a Utube video. There are also lots of comments to help you understand what each line is for
There also lots of C++ tutorials online. I've found cplusplus.com very useful. If you check them out, start here: http://www.cplusplus.com/doc/tutorial/program_structure/. A google search will reveal hundreds of the same kind of site.
Experiment, play and have fun.
int LEDPin=13;
int waitTimeOn=900;
int waitTimeOff=100;
void setup(){
pinMode(LEDPin, OUTPUT);
}
Void loop(){
digitalWrite(LEDPin, HIGH);
delay(waitTimeOn);
digitalWrite(LEDPin, LOW);
delay(waitTimeOff);
}
Delta_G:
You got a typo in the declaration of void loop. void shouldn't be capitalized.
Delta_G is correct, sorry. I typed it into a word document and it must have capitalized it.