275Views7Replies

Author Options:

Cant write code on arduino help! Answered

i want to know how to program an arduino uno but i dont know how theres always and error
please reply

Discussions

What error, when ??

Steve

0
user
PKM

6 years ago

My advice (as a comp sci purist) would be learn to write C first, then go back to the Arduino. Get yourself set up with a compiler and a book or decent tutorial website on C, write a Hello World and a FizzBuzz and a factorial function and all of those classics. Then once you understand the language you can go back to the Arduino and start playing around with a better understanding of what you are doing.

C is actually one of the simplest* languages around, but until you have a basic grasp of how programming languages work (and how to understand a compiler error like "Unterminated string literal on line 34") you won't get very far.

* simple sadly doesn't mean easy

but that's the thing i cant write a code at all

Assuming you have your arduino hooked up to the computer via USB, it is a two part process.

You need to get your circuitry right or the hardware you are going to use.
And you need to be able to load the sketch onto the arduino sucessfully in order for it to run or figure out how to troubleshoot and debug your arduino.

There are a whole bunch of sample sketches that is loaded with the sketch builder. Try blinking the LED on the arduino first. Then you can copy lines to vary the length of delay for blink, etc. Hook up some more LEDs and make them blink in sequence. Start small to learn the logic and syntax. You can always load a sample sketch and build from there. Good luck.