Pages: [1]   Go Down
Author Topic: How did you learn programming the Arduino?  (Read 7909 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 42
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm planning on buying an arduino in the holidays! I can't wait!
But how did you people learn the language?

Im buying the starter kit that includes the "Getting started with Arduino" book.

Tell me about your experiences!  smiley-wink

PS:  How would I be able to make a seven-segment display that increments a number from 0 to 9?
I was thinking. if you would make an internal timer that increases every second, with an delay that is. will your other code after the delay execute as well?

I mean, lets say you have some IF statements.
If time ==1 {
A=0, B=1,C=1 etc etc.
}
These statements must be able to run continuously. although will they be able to do this when the time is delaying?

Thanks in advance!
Logged

U of A, Tucson, AZ
Offline Offline
Full Member
***
Karma: 0
Posts: 164
Hello World
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would go to http://arduino.cc/en/Tutorial/HomePage and start with the Blink example, and work your way down.  Be sure you understand why everything happens before heading on to the next one.
Logged

Calgary, AB, Canada
Offline Offline
Full Member
***
Karma: 0
Posts: 196
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you have a library local to you, check for a book entitled "Sams Teach yourself C in 24 hours"

It's not Arduino specific, but they are great books to get started in programming as a whole.

As mentioned, the tutorials on here are excellent as well.  
Logged

London, England
Offline Offline
Edison Member
*
Karma: 4
Posts: 1026
Go! Go! Arduinoooo !!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There are plenty of tutorials around the interwebnet. Such as the Ladyada tutorials or Tom Igoes website.

Any book on C programming will also help you.

Logged

South Africa
Offline Offline
Full Member
***
Karma: 1
Posts: 141
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The first thing that I noticed when I saw Arduino code was that its C.

I would suggest like everyone else is saying, go and learn the basics of C while you are waiting for the board.

Beside being useful for working with Arduino learning C will help you with PHP, Java, Javascript, not to mention give you a foundation to go one C++ or C#.

C was one of the first languages I learned after BASIC. So far investing in learning C has been very good, because it has allowed me to move to so many other langauges. You can see how C has has inspired so many other programming and scripting languages. I can even see how python was inspired by C.

If you can get your hand on a book called C programming by Kerningham and Ritchie the inventors of C, you will find more than you need. Otherwise if you are very new to programming just learn the basic sytax of C which is all you need to get started with Arduino and build on that as you go along.
Logged

South African Arduino User Group

http://arduino.za.net

Norway@Oslo
Offline Offline
Edison Member
*
Karma: 13
Posts: 2033
loveArduino(true);
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've used and continue to use Arduino in order to get a deeper understanding of C++.

It is brilliant to explore abstract programming subjects.
Get that led to blink no matter what: pointers, arrays, protothreads, finite state machines, multiplex/demultiplex, polymorphism, templates, linked lists... you name it, Arduino does it smiley-wink


A great tool for learning as well as creating!
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 133
Posts: 6755
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OTOH, I would say that part of the idea of Arduino is that you can accomplish interesting things without really having to learn programming first, similar to the way you can draw with crayons without an art class or saw wood without carpentry training...
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's not C, "a subset of C++" strikes me as the best description I've heard yet.

It's an important distinction, as say pasting functions from my .c files into a .pde file will result in error.

You can incorporate .c files in your arduino project though smiley
« Last Edit: July 04, 2009, 09:21:40 pm by rFree » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

to me, its not to far off from php, if you happen to be a web developer like me

then again, php is based on C, so it should "look" like it

as for your programming question, if i understand it right, you want only the if statement to run and not the code after it

any if statements after the one your concerned about, if they match the condition, would execute normally

you may wanna use a case statement as it would be a little more efficient in my opinion

as i'm trying to come to grips with the mechanical side of arduino, the programming side is the same. you have this language. it's capable of doing all kinds of stuff, and theres usually many ways of doing something. you need to figure out what you want to do and how you want to do it. you can use an if statement; a case statement; etc... your experience with the language and how much time you want to invest will usually dictate what you will do, code side (and probably mechanical side as well)

my 2 cents anyways.

-Mario
Logged

0
Offline Offline
Faraday Member
**
Karma: 23
Posts: 3482
20 LEDs are enough
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually the language is C++. The IDE tries to hide this but it actually does a poor job in doing so. Even though it seems nice it implies that you never get proper line numbers from the compiler. Especially the IDE can not show you which lines correspond with which bug. And of course you can not control the prototypes and hence you are pretty much bound to predefined types in the function interfaces. Unless of course you understand more of C than you are expected to.
Logged

Check out my experiments http://blog.blinkenlight.net

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i learned a lot from searching to internet........ but i found a started kit thing online that printed out and that was very helpfull to me
Logged

London, England
Offline Offline
Edison Member
*
Karma: 4
Posts: 1026
Go! Go! Arduinoooo !!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here you go - http://www.earthshinedesign.co.uk/ASKManual/
Logged

New York
Offline Offline
Edison Member
*
Karma: 1
Posts: 1023
E != m*c^2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I wouldn't say php... php always strikes me as similar to xml (but I use both for only basic things, and usually only read the code, not write it myself), but for one reason or another, arduino-code reminds me of my first language - actionscript.
Logged

Pages: [1]   Go Up
Jump to: