Go Down

Topic: Getting Started With Arduino and C (Read 2 times) previous topic - next topic

Grumpy_Mike

Quote
@Grumpy_Mike...
Re-read section 4 of the C Ianguage Standard

No, I have much better things to do with my time than jump through software politically correct hoops deciding if something is or isn't part of a core language. In my book if it needs an include file then it isn't period. Most of C is written in C and has to be added later. It was designed like that and has developed like that. If I was in to compiler writing then yes the standard would be important, but I am not and I have no need to.

There is a myth that C is portable, this was never true, it isn't true and it will never be true. Sure it is quite portable but in any real system you will always have to change something to get it to run on another system, or even the same system but another environment.

Without being personal, as I have never had to work with you, I have had to manage people who show this attitude to standards. They have been all, without exception, very good at the nit picking, and hopeless at actually getting stuff to work correctly in the space allotted, and the speed required, on any given processor.

The simple fact that I/O is at different addresses on different processors means there is always going to be some fettling needed when switching processors. Couple that with different types of built in hardware, UARTS, I2C, SPI, A/D, D/D and other such goodies completely knocks on the head the concept of portability at the level the OP is asking about.

Quote
Since that acid test eliminates all standard functions

Standard functions are what they say standard functions, not part of the core language.

AWOL

#31
Feb 15, 2012, 11:33 am Last Edit: Feb 15, 2012, 11:35 am by AWOL Reason: 1
I wrote perfectly valid, executable C for many years without ever once encountering or writing a "main" or an "exit" - there are places, after all, where there is no place to "exit()" to!

Quote
Standard functions are what they say standard functions, not part of the core language.

Amen.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Morris Dovey

I'm certainly glad to have all this straightened out...
...and now I see why the Arduino needs a reset button.

I'd been wondering about that.  :|
There's always a better way!

kd7eir

Quote
Back to your original question. The best way to go is to buy a book. Preferably the one I wrote called 'Programming Arduino: Getting Started with Sketches'.
A search on Amazon will find you all sorts of good C programming books and if you know C#, you will not find it hard. But you will end up writing code where function names start with a capital - curse you Bill Gates!
Books are distilled knowledge! Save yourself some time.


I second the acquisition of 'Programming Arduino: Getting Started with Sketches'.  I have learned more from that one book than any other.

Go Up