
Install sublime text and the mingw-w64 c++ compiler, then update system path to link the compiler. Open sublime text, write a hello world, and build with c++.
Learn to use Arduino serial monitor to send color commands, drive an RGB LED via analog pins A1–A3, and simulate the circuit in Proteus with typecasting.
Explore variables and data types in C++ and Arduino. Declare and assign integers, and use cout for basic output and cin for input via the serial monitor.
Explore arithmetic, logical, and bitwise operators in expressions, learn how true and false govern boolean logic, and apply and, or, not gates and bitwise shifts in C++.
Learn to read and send data between the arduino and the serial monitor to drive a three-color rgb led on analog pins a1, a2, and a3.
Explore type casting and type conversion to convert variables to different data types in C++, using floats and Arduino serial input/output. Understand multi-line and single-line comments in C++.
Master C++ with practicals in Arduino introduces conditional statements, including if, if-else, and switch, to make decisions and control flow with examples of printing and break usage.
Master loops in C++ and Arduino by exploring for, while, and do while constructs that repeat code blocks. Learn how known iteration counts and conditional exits drive printing and increments.
Explore do-while loops, break and continue statements, and nested control structures in C++ with Arduino projects, learning how each construct affects flow and iteration.
Discover the basics of machine learning and deep learning, learn convolutional neural networks with PyTorch for image tasks, including convolutional and pooling layers, flattening, and fully connected classifiers.
Embark on a journey into the world of Machine Learning, Deep Learning, C++, and Arduino with this comprehensive guide. This book is meticulously crafted to provide a robust understanding of the fundamental concepts and hands-on experience with practical implementation using LibTorch (the PyTorch C++ API) and C++.
The book begins with an introductory course on C++ and Arduino, designed for beginners and those looking to refresh their knowledge. This course covers everything from the basics of programming in C++ to the intricacies of working with Arduino, all taught from scratch. It provides a solid foundation for the subsequent modules.
What you will learn
The book is structured into nine distinct modules:
Introduction to C++ and Arduino - This module serves as an introductory course for beginners. It covers the basics of programming in C++, the use of Arduino IDE, and the fundamentals of Arduino programming.
Introduction to Machine Learning and Deep Learning - Acquire the basics of Machine Learning, Deep Learning, and Neural Networks.
Convolutional Neural Networks - Comprehend Convolutional Layers, Pooling, and Fully Connected Layers. Construct a CNN using PyTorch.
Practical Implementation with LibTorch - Gain knowledge about Data Loading, Preprocessing, Training a CNN Model, and Model Evaluation and Optimization.
Integration with Arduino - Delve into Arduino, On-device AI, Edge Computing, and the process of deploying a LibTorch Model on Arduino. Understand the potential of Arduino in facilitating real-time machine learning applications and how it can be used to implement and test machine learning models in a hardware environment.
Training and Testing the CNN - Understand the procedure of training and testing a Convolutional Neural Network (CNN) on a dataset.
Exporting the Trained Model in LibTorch and ONNX - Learn the method to export a trained LibTorch model and convert it into the Open Neural Network Exchange (ONNX) format.
Loading and Using the Model in C++ - Learn the technique to load the exported ONNX model in a C++ environment and use it for inference.
Optimizing C++ Code - Discover various strategies to optimize the C++ code for enhanced performance.
Advanced Topics - Learn about advanced CNN architectures and their implementation using LibTorch.
Table of Contents
Introduction to C++ and Arduino
Introduction to Machine Learning and Deep Learning
Convolutional Neural Networks
Practical Implementation with LibTorch
Integration with Arduino
Training and Testing the CNN
Exporting the Trained Model in LibTorch and ONNX
Loading and Using the Model in C++
Optimizing C++ Code
Advanced Topics