Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Arduino language vs C best way of learning

Status
Not open for further replies.

Michael_N

Member level 2
Joined
Jan 11, 2012
Messages
47
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Denmark
Activity points
1,685
POST NOT SOLVED!
I have to select the Solved prefix on my IPhone app.

Hi All,

I have just bought an Arduino Uno board and I have tried different things like cinnecting a LCD display and making a voltmeteret etc. And yes it is so easy!

I really samt to learn programming and I started of buying the STK500 kit using avr codevision. But I quickly get stuck, not knowing how to code something, for an example to get a LCD display working. To get help I turned to Avr Freaks forum but my experience is that asking for code examples there is like an insult to the members.

Back to Ardunio, with all the projects it should be easier to learn coding, reading earlier posts made here I read that the Ardunio language is different from "normal C" :(

Can you guys recommend me the best way to learn coding? Attending an education to learn it is not an option for me at the time, so it has to be a way of self learning.

I don't hope that my post was to long and boring to read:) every suggestion from you is appreciated greatly!:)

Kind regards
Michael
 
Last edited by a moderator:

Re: Arduino language vs C best way of learning (NOT SOLVED)

Hi Michael,

If you wish to persevere in C, then the attached doc here may help - I wrote it in simple language to get anyone started,
at least to the point of writing the first program with a switch as input and LED as output, and getting it compiled and
downloaded.
I've heard Arduino is easy to use too, but I've never tried it. Perhaps someone else has a good link for Arduino coding.
The best way to learn C (in my opinion) is to follow a textbook unfortunately. The (short) classic reference is
"The C Programming Language" which is suprisingly expensive for such a short book, but it is worthwhile - I think most people
would recommend it. It has high resale value. I also used another book called "Problem Solving and Program Design in C" which
again is expensive but you could get an old edition (C doesn't really change over the years).

The good thing is that C is quite a short language, maybe 20-30 keywords? So it won't take you long to begin writing
software. And you could learn it quite easily on your PC; on a Windows machine download "mingw" (or cygwin - select GCC when installing it)
or on Mac you can use 'gcc' directly, and for Linux you can install gcc as a package - lots of web links on these subjects.
If you get stuck, this forum has many people familiar with C.
 

Attachments

  • programming_microcontrollers3.pdf
    6.6 MB · Views: 200

Hi,

The Uno is so easy, but as you say its not what I class as 'programming' just running other folks precoded routines.

Seems that precoded modules are the basis of any form of C and in todays large real world programs it is essential to use it that way.

However if you want to really understand the working of the micro chip architecture in greater detail then perhaps looking at Assembler coding might interest you ?

Its extremely detailed and can seem difficult at first , but a friend who uses C, did give it a go, and agreed it really taught him so much more, and helped him when he returned to C.

I have no experience of Assembler on the Atmega chips; not sure how well it is supported either.

I use the Microchip Pic chips and there are lots of tutorals and help in this and other forums.

Have a look at this thread where I have just posted some starter code to help someone get their lcd running.
https://www.edaboard.com/threads/258736/ entry #11

Also have a look at these two tutorials, one also does C examples
Most Pic C compliers have free limited versions and Assembler is totally free.

http://www.winpicprog.co.uk/pic_tutorial.htm
**broken link removed**
 

I started of buying the STK500 kit using avr codevision. But I quickly get stuck, not knowing how to code something, for an example to get a LCD display working.

If you are using codevision then there are already a lot of libraries included.
The LCD pins can be set in the wizard and then it is just a matter of a few lines to print your messages.
Check the LCDDEMO in the example folder of CVAVR

Alex
 

Hi all,

Thanks for all of your interesting replies!:)

Sky_123:
I will try to find the books you mentioned on Amazone, I think it will be very helpfull with a book.
Thanks for the pdf document, I will tak a closere look at the code examples later. I already have some material with assignments and some examples how make leds blink, make different sound melodies, and actally how to make drivers. But unfortunally the material is from a school for engineers, so I'm missing the explanation and the basics to solve the the assignments fully.

WP100:
I agree with you, Arduino is a bit to easy... It is a shame that it is not more similair to "normal c language"
I think I have read about Assambler code in the book "C for dummies" To start with I mostly keen on just learning the c language. As assambler code seemed to be very difficult.
Thanks for the links, even though I program Atmel's and not PIC's the code language should be same, right?

Alexan_e:
I have never tried the Wizard, cause a friend of mine told med that it didn't work well... But I will try it and see if I can't get the LCD display to work. I have really been seaching for code or examples of how to use lcd display, and the adc.

Kind regards
Michael
 

I have never tried the Wizard, cause a friend of mine told med that it didn't work well... But I will try it and see if I can't get the LCD display to work. I have really been seaching for code or examples of how to use lcd display, and the adc.

I'm using it very often to generate the initialization code which I copy to AVRstudio since I use avrgcc , I find it extremely convenient.
I would be curious of the specific problems that your friend had while using the wizard.

Alex
 

, even though I program Atmel's and not PIC's the code language should be same, right?


Hi,

They are similar Assemblers but not directly interchangeable.

Have all look at all types of compliers and go with whichever you can understand more readily - once you have learnt some code you might see that something else which would be better, but by then you will have learnt a lot so its then easier to move onto another complier if needed.
 

Hi,

Well my friend told me that it sometimes didn't make the code the best way. But at the time he attended an education as an engineer, so I guess he had that info from a teacher.

Sky_123: I have found the books you menioned but there is differents books with the same title.... Do you know the author of the one you mentioned?

Kind regards
Michael
 

Hi Michael,

The C book authors are Kernighan & Ritchie for the first book, and Hanly & Koffman for the second.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top