Arduino Microcontroller & C++
Unit Overview, Introduction, Outline
This Unit is all about learning to use the Arduino Micro-controller and Learning to program it with C and C++. While the goal is to learn C++, the main goal of this Unit is to learn to programmatically access sensors and other input devices, act on them with a control program, and then manipulate outputs to actually control the real world. I teach C++ before I teach Python, not because I think it's a better language, but rather because I want to use the Arduino platform first.
While We say we teach C++, for all practical purposes we are learning C, because we really are not going to get into the Object Oriented aspects of C++
This is my best attempt to create a Mechatronics Engineering Arduino Resource page. Let me know how to make this better, what I may be missing, and what I can add. Contact me at TopClown@STEAMClown.org.
Learning Objective:
This Arduino & C++ Unit is intended to introduce students not just the syntax of coding, but to the concept of Design Thinking when playing with an Arduino or planning and writing a C or C++ Program.
Inspire Life Long Learning by applying concepts like Design Thinking and Computational Thinking, Top Down Design and step by step Problem Decomposition and Debugging
Students will have a basic, but fundamental knowledge of setting up, configuring, and connecting an Arduino to the physical world.
Apply Scientific Methods, fundamental principles of computer science to design Top Down, modular and reusable Arduino code
Demonstrate the principles of object-oriented programming and the interplay of algorithms and data structures in well-written modular code;
Solve C & C++ coding exercises and problems requiring the writing of well-documented programs in the C++ language
Demonstrate significant experience with the Aduino IDE program development environment
Prerequisites:
No explicit prerequisite course work or coding knowledge is required, but students are expected to have a good understanding of basic computer principles. You will need to have access to an Arduino and a personal computer so you can write programs and do the lab assignments and the final project. The Arduino IDE runs on Windows, Mac OS X, and Linux, so almost any computer will do.
Access to an Arduino- In class, we'll be showing programming examples on a n Arduino, using the Arduino IDE application . We'll be using C++ in this course.
Getting Started
Online C++ Coding Interpreters
While I teach my C++ coding using the Arduino as the main platform, sometimes you want to just try some code on line.
C++ Tutorial
C++ Tutorial Page - This is a good tutorial for learning C++
Online Class you can sign up for:
Udemy - Arduino Workshop 2018 | A step-by-step Arduino how-to guide This is a Udemy class we will be using as a class "text book" resource. You should get a Udemy account and work through each lesson. You should have an Arduino, a breadboard and various electronic components, like resistors, LEDs, and other stuff.
Online Books and Guides
Arduino in a Nutshell Rev 1.1.3 (PDF) - Source RWTH Aachen University This is one of the web PDF resources we will be using as a class "text book"
Arduino & C++ Lessons, Lectures, Labs
Lesson 1 - C++ Introduction: Playing with C++ in an Online GCC Compiler/Interpreter
This lesson is just a quick introduction to the C++ code. This is a Step by Step guide to introduce the Hello World, and the idea of asking questions with the if/else else if conditional statements. The last example is a while loop.
Next Steps and Dig Deeper is to start looking at the Tutorials Point- Learn C++ Tutorial. Try out the code examples found there in the online GCC Compiler/Interpreter
Lesson 2 - Arduino Introduction
This lesson is an introduction to the Arduino, and Blinking an LED with your first Arduino C++ program. This is the lesson where you will get your own Arduino.
Lesson 3 - Using An Arduino in TinkerCAD
TINKERCAD - Make learning fun with 3D design, Circuits, and Codeblocks. TinkerCAD not only lets you learn 3D design, simulate electronic circuits and learn to code. You can build a circuit that includes an Arduino, and you can run simulated code. You don't need to have the physical hardware. You can simulate real world hardware on your computer. Re-create ann Arduino, Breadboard & LED lab on your computer. Sign up and play
Lesson 4 - Algorithms & Flow Charting
This lesson will cover what an Algorithm is and what a Flow Chart is. You will learn how to break a challenge down into a smaller "chunks" using the concept of "Top Down Design". You will use Flow Charts to define all the steps of a program before you write any code.
Lesson 5 - Blinking An Output LED & Adding A Switch Input
Lesson 6 - Program Control - IF / Else / Else If
Lesson 7 - Program Control - For Loops
Lesson 8 - Program Control - While Loops
Lesson 9 - Sensors - Gathering Data From The Real World
Lesson 10 - Functions
Lesson 11 - Sensor Examples And How They Work
Lesson N-X - 2 X 16 LCD And Writing A Message
Lesson N-X - 5 Buttons On 1 Analog Pin
Lesson N-X - Turning On A Motor & Finding The Limits
Lesson N-X - Making Sound With Tones
for more, please see my Mechatronics Engineering Blog Page for now... I'm going to update and move this content summer of 2019