Arduino Forum

Topics => Education and Teaching => Topic started by: mudmin on Aug 23, 2017, 06:05 pm

Title: C/C++ Course Specifically for Arduino programming
Post by: mudmin on Aug 23, 2017, 06:05 pm
Does anyone know of a course specifically for programming C/C++ for Arduino. 

It just seems like the courses focus on C/C++ have a ton of stuff in them that is completely irrelevant to the arduino.

It also seems  like arduino-focused courses start with a few of the programming basics and then jump right into focusing on relays and LEDs and completely ignore the fundamental programming part of it.

Considering these boards are sold by the millions, there HAS to be someone out there teaching a C for Arduino course, right?
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: Paul_KD7HB on Aug 23, 2017, 06:18 pm
Does anyone know of a course specifically for programming C/C++ for Arduino. 

It just seems like the courses focus on C/C++ have a ton of stuff in them that is completely irrelevant to the arduino.

It also seems  like arduino-focused courses start with a few of the programming basics and then jump right into focusing on relays and LEDs and completely ignore the fundamental programming part of it.

Considering these boards are sold by the millions, there HAS to be someone out there teaching a C for Arduino course, right?
How have you determined your statements? Have you taken the courses you disparage? Did you begin reading world history books in the first grade? All the C/C++ stuff is relevant to programming the Arduino. Perhaps you need to do more Arduino programming to discover the connection to all C/C++.

Paul
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: mudmin on Aug 23, 2017, 06:28 pm
How have you determined your statements? Have you taken the courses you disparage? Did you begin reading world history books in the first grade? All the C/C++ stuff is relevant to programming the Arduino. Perhaps you need to do more Arduino programming to discover the connection to all C/C++.

Paul
I didn't disparage anyone or anything.  I just keep getting answers like "well it's a subset of c or c++." 


Title: Re: C/C++ Course Specifically for Arduino programming
Post by: KeithRB on Aug 23, 2017, 06:32 pm
The basic language is full C, only the standard library is a subset, i.e., no stdout or stderr.
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: Robin2 on Aug 23, 2017, 07:12 pm
Does anyone know of a course specifically for programming C/C++ for Arduino.  
I think a distinction can be made between learning C/C++ and learning to program an Arduino. All of the Arduino code is C/C++ but not all of the full scope of C/C++ is relevant to an Arduino. The amount of C/C++ that is essential for Arduino programming is probably quite small.

You have not told us what style of learning works for you - whether you prefer a text-book style or a "suck-it-and-see" style.

I like to look at examples (and there are plenty with the Arduino IDE) and then if I see something I don't understand I can spend some time with Google, etc. learning about it.

I suspect there is no shortage of online tutorials for Arduino programming and for C/C++ programming.

The advantage of the examples is that it brings you in contact with the things that are specific to the Arduino at an early stage.  And (for obvious reasons) they do not involve irrelevant C/C++ stuff. However I am not saying that the examples illustrate best-practice C/C++ coding. Many of them fall short of that. But they get the job done.

...R
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: econjack on Aug 23, 2017, 08:30 pm
I know for a fact there are a lot of intro C programming books aimed specifically at the Arduino family.
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: mudmin on Aug 23, 2017, 08:36 pm
I suspect there is no shortage of online tutorials for Arduino programming and for C/C++ programming.

The advantage of the examples is that it brings you in contact with the things that are specific to the Arduino at an early stage.  And (for obvious reasons) they do not involve irrelevant C/C++ stuff.
I appreciate the idea of the examples. That's what I generally wind up doing.  It usually winds up that I'm trying to extend the example and I'm having issues with the data not being in the variable type/format that the next thing I'm trying to do needs.

I will say that this thread is a pretty typical example of the frustration of the arduino community.  Other than you, I just get lots of "there's plenty of them." Tons of books. Tons of courses. Yet not a link or even the name of one when that's clearly what I'm asking for. 

I truly appreciate everyone's time...I just think that this is a huge thing that's lacking in the arduino community.
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: econjack on Aug 23, 2017, 08:46 pm
I just get lots of "there's plenty of them." Tons of books. Tons of courses. Yet not a link or even the name of one when that's clearly what I'm asking for.  
Yep, we are remiss in not doing that for you. I just googled "beginning C for Arduino" and got 1.4 million hits. Give me a couple of days to cull that list for you since you can't find any links.
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: Robin2 on Aug 23, 2017, 09:21 pm
I will say that this thread is a pretty typical example of the frustration of the arduino community.  Other than you, I just get lots of "there's plenty of them." Tons of books. Tons of courses. Yet not a link or even the name of one when that's clearly what I'm asking for.  
I don't know whether I am typical of the more frequent posters here but I have read none of the books and I don't think I went through any of the tutorials.

I have been doing hobby programming for 35 years or so and I knew enough when I got my first Arduino so that I did not need them. I do have books on Ruby, Javascript, HTML and CSS. But I guess if I was starting those things now I probably would not buy them - just learn from the internet. For example when I switched (reluctantly) from Ruby to Python I did not buy a Python book.

Strange as it may seem you are more likely to get good advice about learning materials from other beginners. But, as far as I can see, they don't bother using the Forum once their own question has been answered.

...R
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: mudmin on Aug 23, 2017, 09:41 pm
Yep, we are remiss in not doing that for you. I just googled "beginning C for Arduino" and got 1.4 million hits. Give me a couple of days to cull that list for you since you can't find any links.
Yep because there's a book by that title. If you get to page 9 there's a single link for the Adafruit learning system, which isn't a c course either. Not one course. 

Nevermind. This is really unproductive. Thanks for those who tried to be helpful.
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: DrAzzy on Aug 23, 2017, 09:59 pm
I have noticed the same thing as OP regarding Arduino-centric resources. They usually stick to code that's very simple from the C/C++ perspective, and focus on interacting with hardware and using libraries to do stuff - all very practical information, but you're not going to learn anything other than basic c/c++ from those sort of resources. They always seem more focused on the hardware than the software.

Meanwhile, books dedicated to C/C++ assume you're programming on a desktop PC, so the sort of patterns they use as examples aren't always good ideas when programming in an embedded environment, and they don't emphasize the parts of the language most relevant to embedded programming.

I tried to find a resource that bridged the gap last year and wasn't happy with anything I found... I frankly haven't been able to find any resources printed on dead trees that I found particularly useful for arduino programming.
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: terryking228 on Aug 24, 2017, 12:11 am
Hi,
Quote
I just googled "beginning C for Arduino" and got 1.4 million hits.
Quote
Yep because there's a book by that title.
So there is. HERE it is on Amazon. (https://www.amazon.com/Beginning-Arduino-Second-Learn-Programming/dp/1484209419/ref=sr_1_1?ie=UTF8&qid=1503526136&sr=8-1&keywords=beginning+c+for+arduino)

This book uses Arduino/IDE for all the examples, but it goes in depth with C, beyond other books I have.

I worked with the author on this book and I have run all the examples.  I think it is good for both Arduino programming and hardware insights.

DISCLAIMER: I am the Technical Editor of this book.

Title: Re: C/C++ Course Specifically for Arduino programming
Post by: mudmin on Aug 24, 2017, 01:45 am
Hi,
So there is. HERE it is on Amazon. (https://www.amazon.com/Beginning-Arduino-Second-Learn-Programming/dp/1484209419/ref=sr_1_1?ie=UTF8&qid=1503526136&sr=8-1&keywords=beginning+c+for+arduino)

This book uses Arduino/IDE for all the examples, but it goes in depth with C, beyond other books I have.

I worked with the author on this book and I have run all the examples.  I think it is good for both Arduino programming and hardware insights.

DISCLAIMER: I am the Technical Editor of this book.


I may just go with the book.  I appreciate it!



I have noticed the same thing as OP regarding Arduino-centric resources. They usually stick to code that's very simple from the C/C++ perspective, and focus on interacting with hardware and using libraries to do stuff - all very practical information, but you're not going to learn anything other than basic c/c++ from those sort of resources. They always seem more focused on the hardware than the software.

Meanwhile, books dedicated to C/C++ assume you're programming on a desktop PC, so the sort of patterns they use as examples aren't always good ideas when programming in an embedded environment, and they don't emphasize the parts of the language most relevant to embedded programming.

I tried to find a resource that bridged the gap last year and wasn't happy with anything I found... I frankly haven't been able to find any resources printed on dead trees that I found particularly useful for arduino programming.
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: mudmin on Aug 24, 2017, 01:46 am
Meanwhile, books dedicated to C/C++ assume you're programming on a desktop PC, so the sort of patterns they use as examples aren't always good ideas when programming in an embedded environment, and they don't emphasize the parts of the language most relevant to embedded programming.

I tried to find a resource that bridged the gap last year and wasn't happy with anything I found... I frankly haven't been able to find any resources printed on dead trees that I found particularly useful for arduino programming.
This is EXACTLY what I'm saying. Maybe I'll learn this stuff and then do an online course. I'm getting there.  It's just way harder than I think it should be.
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: jbellavance on Sep 16, 2017, 06:53 pm
So there is. HERE (https://www.amazon.com/Beginning-Arduino-Second-Learn-Programming/dp/1484209419/ref=sr_1_1?ie=UTF8&qid=1503526136&sr=8-1&keywords=beginning+c+for+arduino) it is on Amazon.

I also got Pro Arduino (http://www.apress.com/us/book/9781430239390) When I got the ATTiny
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: AWOL on Sep 17, 2017, 09:43 am
Try udemy.com
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: Eddiie on Jul 29, 2019, 02:28 am
Why is the book called "C" and not "C++"?
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: econjack on Aug 03, 2019, 03:13 pm
@Edie: The book is specifically written for the person with absolutely no programming experience and concentrates on the Arduino version of C (e.g., no double data type). The second edition edition has a chapter at the end of the book titled A Gentle Introduction to Object Oriented Programming and C++. There is no way to teach C++ in one chapter, but it slants the narrative to understanding why most Arduino libraries are written in C++ and how to understand the syntax used in those libraries.

A good way to judge the book's effectiveness is to read its reviews. I am totally biased towards the book since I am the author. Terry, who commented earlier, made notable improvements in the book, which is one reason I encourage people to make sure they get the 2nd edition.
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: RuskinF on Oct 21, 2019, 01:51 pm
There are various Youtube and other resources available for learning C/C++ programming in Arduino like ones made available by Derek Banas, Programming Electronics Academy and the Arduino Class
You can get books as well for learning C/C++ programming if you learn better through texts.
I think people have already mentioned them in the comments.
Peace.
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: Rwmurphree on Apr 30, 2020, 09:01 am
A really good video tutorial series is Paul McWhorter, He worked as a EE at Sandia and retired to teach high school engineering and science in texas. This is remake of his first try at the online tutorial.  It requires a intro to
arduino kit, specifically the Elegoo super kit. He is on "Arduino tutorial 59: " The course designed for someone with only algebra I, for x = x + 1, he can explain electronics, programming, arduino to the man on the street. I am not kidding he goes slow enough and uses the arduino and components in the kit for a general high school
into to computers course.  C is a fine grain language that strongly typed, an 1970's structured language, wierd feature called a pointer difficult to debug, a thorough course might cover it in a year, it is used for introduction to programming course. I"m taking McWhorter's course, i'm on lesson 21, my guess is c on embedded arduino is harder than on larger pc platform,less well behaved, less memory.  But embedded processors have been used paired with a few sensors, or a few actuators, your 15,000 line senior semester project will not fit in it. McWhorter slowly develops physics of leds, use of leds, resistors, potentiometer, basic ideas of binary numbers,
if, while, for, c concepts.  But you learn to output digital and pulse width modulation to leds, and read, analog to
digital to the arduino.  So you learn the steps of reading sensors and writing to actuators, while you are learning the basics of c programming.  Extraordinary!  Just enough about how the led's work to make it
a detailed "thick" object. He is a master teacher, but one its subject is how to use arduino + C to talk and
control sensors and actuators. And not so much understanding total structure and instruction sets of arduino
boards and chips.  But he shows you basic functions of use the sensors, writing to actuators, motors, and
it is explained so well that you aren't afraid to USE THE ARDUINO FOR USING SENSORS AND ACTUATORS
WITH SOFTWARE.  So in summary, you learn basic c control structures, a
While (my sensor reports() ) {
     if ( my sensor values are in range ) {
          do something ;
     }
     else ( my senors values dangerous) {
            take efforts to avoid danger
     }
} // end while

the course has basic intro to computers, basic electronics, basic programming, talking to sensing, motor
controls not just floats, ints, and strings.



Table of contents of Paul McWhorter 2019 edition videos.
ttps://www.youtube.com/watch?v=fJWR7dBuc18&list=PLGs0VKk2DiYw-L-RibttcvK-WBZm8WLEP
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: Rwmurphree on Apr 30, 2020, 09:31 am
link McWhorter Arduino Tutorial
https://www.youtube.com/watch?v=fJWR7dBuc18&list=PLGs0VKk2DiYw-L-RibttcvK-WBZm8WLEP
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: terryking228 on May 01, 2020, 12:26 am
Quote
my guess is c on embedded arduino is harder than on larger pc platform,less well behaved, less memory.  But embedded processors have been used paired with a few sensors, or a few actuators, your 15,000 line senior semester project will not fit in it.
Hmmm.. Not sure I agree...  Same Gcc compiler used on many,many boards and projects. And there are several Arduino versions, with LOTS of memory.

I have a complex (to me)home automation system in about 2500 lines. It users 23% of an Arduino Mega.
Title: Re: C/C++ Course Specifically for Arduino programming
Post by: Rwmurphree on May 05, 2020, 08:59 am
Terry, i'm a arduino newbie,
some arduino mega's have 256 KB,
I see nano ble has 1 MB of memory. so yes that might allow larger programs.
My elegoo  kit has an arduino uno with 32K flash.
I remember programming pre-ibm pc desktop pc in the 70's with 128K and 256K (vector graphics) with large 7in floppy drives so the arduino uno v3 might look like a small memory to some.