Go Down

Topic: My first ever Arduino Program (Read 757 times) previous topic - next topic

0d1n411f4th3r

Hi Guys,

I was working as an Animatronic engineering assistant for the last year, creating the frames (Welding, etc etc) I dabbled in electronics as I found it extremely interesting and developed a shed load of curiosity. I'm not electronically minded as far as micro-controllers go so with help, my manager presented me with a basic Arduino Kit

- Uno R3 board ( Sainsmart)
- Resistors
- Led's - red, clear and yellow
- Rainbow pins (that's what I call them, not sure if terminology matters)

so I've watched this video from Jeremy Blum. (I'm literally half way through his first tutorial video. Basically, I've written my first program (Standard blink program) as Jeremy has explained. But what he didn't explain was if an error message appeared.

This is my error message ;


Arduino: 1.8.0 (Windows 10), Board: "Arduino/Genuino Uno"

Liamsfirstsketch.ino:9: error: initializer provided for function

 (

 ^

Liamsfirstsketch.ino:12: error: expected unqualified-id before ')' token

 )

 ^

Liamsfirstsketch.ino:17: error: expected constructor, destructor, or type conversion before '(' token

 delay(1000);

      ^

Liamsfirstsketch.ino:18: error: expected constructor, destructor, or type conversion before '(' token

 digitalWrite(ledPin, LOW);

             ^

Liamsfirstsketch.ino:19: error: expected constructor, destructor, or type conversion before '(' token

 delay(1000);

      ^

Liamsfirstsketch.ino:21: error: expected unqualified-id before ')' token

 )

 ^

exit status 1
initializer provided for function

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Now I'm not sure what this means as obviously in the tutorial video it doesn't explain. I have literally copied the coding to a 't. I've checked that it's connected to the correct COMS port, which in my case is COMS3 and i've also made sure that I'm programming the correct board - Arduinio/Uno

Please can anyone help me?

thank you very much.

manor_royal

I think your to a "t" may be a bit off, suspect a simple typo.

So post your code and let's have a squiz.

If this was a Civil Engineering forum would there be posts like "I need to build a bridge. Someone send me drawings."

0d1n411f4th3r

#2
Jan 16, 2017, 03:32 pm Last Edit: Jan 16, 2017, 03:38 pm by 0d1n411f4th3r
Hi Manor,


I've figured out the issue. I was using 'ledPin' in my code and not using ledBuiltin like I should've been. I apologise for wasting your time and appreciate the help you would've offered.


sorry again :(

Liam

manor_royal

Ok that's weird it compiles 100s for me.

If this was a Civil Engineering forum would there be posts like "I need to build a bridge. Someone send me drawings."

0d1n411f4th3r

What do you mean 'Compiles' 100's for you?

manor_royal

Verifies 100%.... no error message when I copy paste your code into the IDE and hit the "tick" button.

If this was a Civil Engineering forum would there be posts like "I need to build a bridge. Someone send me drawings."

0d1n411f4th3r

Oh, random.


Anyway, it's now fixed and working 100% stupid error on my part. Again, thanks for your help and apologies for time wasting.

- Liam

Robin2

Anyway, it's now fixed and working 100% stupid error on my part.
If you aspire to become a programmer you need to get used to making stupid errors :)

Don't worry about it.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

PaulMurrayCbr

You have just discovered that C compilers are very, very finicky. Programming is one of the few areas of engineering without tolerance. Either your program is perfect (with respect to the C syntax definition), or it doesn't compile.
http://paulmurraycbr.github.io/ArduinoTheOOWay.html

PaulS

Quote
You have just discovered that C compilers are very, very finicky.
You misspelled "precise". 8)
The art of getting good answers lies in asking good questions.

Go Up