Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.

Arduino, C++, Mac
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Arduino, C++, Mac

by keithg on Tue Apr 07, 2009 5:32 pm

Learning to write an Arduino sketch is frustrating because, aside from a brief introductory guide, there would seem to be no definitive text available. Is this because Arduino is essentially C++? Is studying C++ on a Mac a problem? Any favorite titles?
Posts: 82
Joined: Thu Oct 30, 2008 8:30 pm

Re: Arduino, C++, Mac

by blalor on Tue Apr 07, 2009 6:34 pm

The Arduino "language" is basically some syntactic sugar and some very helpful libraries, all built on top of avr-gcc and avr-libc. I find this avr-libc manual to be extremely helpful. I also keep the Arduino extended reference at the ready.

Posts: 30
Joined: Tue Jan 06, 2009 11:37 pm

Re: Arduino, C++, Mac

by mtbf0 on Tue Apr 07, 2009 6:51 pm

studying c++ won't help you much. there's not a whole lot of it used in an arduino sketch. most of what you write will be pretty much straight c. but studying c won't help you a whole lot either because a lot of the libraries that make a language useful on a system with an os to moderate things just aren't there on an arduino. the arduino reference does a pretty good job of explaining c operators and it describes the helper functions available and the serial library and that's pretty much all there is.

tom igoe's making things talk is an excellent introduction to getting some pretty interesting things going.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

Re: Arduino, C++, Mac

by westfw on Tue Apr 07, 2009 11:28 pm

The problem with C++ is that nearly all of the C++ books are going to be oriented to writing desktop applications for operating systems like windows, which is MUCH different than an arduino.

Find a book in programming microcontrollers in C, and you'll be better off. The pieces of C++ used in the Arduino environment are only slightly beyond C (and of course, you can write relatively pure C programs.)

Posts: 1678
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Please be positive and constructive with your questions and comments.