Products > Embedded Computing

Good C programming books

(1/12) > >>

Jwillis:
Hey folks. I haven't done any programmming in C since the ATARI ST days (1985-1991)  and I lost or gave away all the resources I used then.Now I'm having a job wrapping my head around this Arduino because I've forgotten everything.
I've started again with a project I found on you tube  using the TLC594016-ChannelLED Driver.
 
But I want to add more chips and do more patterns. I managed to figure out the circuit schematic reading the programming text. but still having trouble relearning the rest.
Can you folks direct me to some decent books so I can relearn.I like books because I find un-printed PDFs hard to work with and some web sites hard to navigate .

 

brucehoult:
This doesn't seem to have anything much to do with C?

p.s. Arduino language is officially called "Wiring" and is a carefully-crafted subset of both C++ and Java and sketches are supposed to work in either. (the IDE automatically adds forward function declarations for C++, and a class wrapper for Java)

I suspect the Java compatibility of standard code isn't checked all that often these days. And of course user-written code often uses full C++ features.

Jwillis:
That explains why it looks so strange. I don't know anything about Java. So What I'm looking for is a book specifically for Arduino coding then?

westfw:

--- Quote ---Arduino language is officially called "Wiring" and is a carefully-crafted subset of both C++ and Java and sketches are supposed to work in either. (the IDE automatically adds forward function declarations for C++
--- End quote ---
This is wrong.  The Arduino Language is officially called "the Arduino Language" (1)

It is based on the Wiring Language defined as part of Hernando Barragán's Master's Thesis (2)

Neither the Arduino Language nor the Wiring Language contain any Java, although they were influenced by "The Processing Language" (3) (which is Java), and have similar abstractions, elimination of build complexities, and rejection of the standard libraries.


While they'd apparently like to believe otherwise, the Arduino and Wiring Languages are both C++, though without the C++ STL or even normal C++ libraries (depending on actual chip, actually.)  They do some trivial pre-processing to generate forward declarations, and then run the standard avr-gcc/avr-g++ compilers.  And they have their own set of "standard" library functions (although avr-libc and/or newlib-nano are present as well.) (4)


You can also include plain C/C++ files in your Arduino projects, and the IDE will handle them fine (just with less pre-processing.)  (And within the limits of the C++ libraries and features available from the particular compiler.)


A good C book is a fine place to start, if you want to understand Arduino code.

westfw:

--- Quote ---A good C book is a fine place to start, if you want to understand Arduino code.
--- End quote ---

I should add that "a good C++ book" is probably a TERRIBLE place to start, if your goal is to understand Arduino.  Most C++ books will immediately plunge you into features and library functions that just aren't there in Arduino (or shouldn't be used, even if they do exist.)
Even for C, the starting "Hello World" program won't work because you need to use "Serial.print()" instead of "printf()"  (But that's the big one for "beginning C", whereas for C++... I think you'd run into a lot more.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version