I am VERY new to programming with the Arduino Uno R3 but have use some older controllers so please go easy on me. Trying to get back into this after about 10 years.
Very simple 3 line sketch using a tab. I keep getting the error "randomNumber does not name a type" during compiling. If I put all three lines in the main program it compiles. What am I doing wrong?
Thanks in advance
David
Main Program:
long randomNumber;
void setup() {
// put your setup code here, to run once:
randomSeed(analogRead(0));
}
void loop() {
// put your main code here, to run repeatedly:
}
In a tab called Pick I have just this single line
randomNumber = random(300);
See all the tabs (they are *.ino files in your project) as one long file.
The code on top is the file with the project name, that is in the most left tab.
You can not put a code line outside setup() and loop(). That means you can not put a code line in a tab.