Skip to content



Through these tutorials, you may learn basic electronics through Arduino.

There are "Try it Yourself" and "Assignment" in the tutorials that you should follow.

Basic Tutorials

  1. Getting Started with Arduino

    • Understand Arduino’s hardware
    • Start using Visual Studio Code IDE with Platform IO
    • Write basic Arduino codes
  2. Basic C++ Programming

    • Know the meaning and usage of different data types
    • Know how to use arithmetic operators, comparison operators and Boolean operators
    • Know how to use if…else, for, while statements
    • You may skip this if you are familiar with C++
  3. Serial Communication

    • Set up serial communication in Arduino

    • Set up communication between Arduino and the computer via pySerial

  4. Basic IO

    • Digital output
    • Digital input
    • PWM output
    • ADC input
  5. Learning Basic Control

    • Control motor’s rotation speed using PWM
    • Detect the speed of motor by speed sensor
    • Perform a basic feedback control
  6. Learning Servo and Sensors

    • Control servo motors
    • Read analog signal
    • Understand analog signal reading and I2C communication protocol
    • Take reading from different sensors
  7. Timer, PWM and Interrupts

    • Understand Timer
    • Use PWM
    • Use External Interrupt
    • Use Timer Interrupt

Beyond Arduino

Arduino IDE is easy to use, but its functionalities are limited and low-level manipulations are impossible with Arduino IDE. If you want to dig deeper on MCU and STM32, you may consider the following:

  • SW4STM32 is a toolchain to program STM32 with STM32Cube HAL and CMSIS, which can be integrate with Eclipse IDE with a Eclipse plug-in.

    • STM32Cube HAL is a hardware abstraction layer (HAL) provided by ST Microelectronics, the manufacturer of STM32. It is more easy to use than CMSIS, but ST may discontinue it whenever they like. (Just like what they have done to STM32 Peripheral Library) Controllerstech offers basic tutorials on how to program STM32 with STM32Cube HAL.
    • CMSIS is a HAL for the Cortex-M processor (including STM32). It is independent to MCU vendors and is considered as the hardcore way. You'll have to read the reference manuals by ST Microelectronics and manipulate the MCU by altering its registers.
  • STM32 can be used with Real-time OS (RTOS), which offers functionalities such as event and multi-threading.

  • FreeRTOS

    We start to use FreeRTOS with STM32CubeIDE in 2020 because they are well integrated.

    • ChibiOS is a RTOS that has been used by M2 members for a few years. There is an article that introduces how to set up a workspace for programming ChibiOS.
  • Useful tool: STM32CubeMX and STM32CubeIDE but you might need a VPN to connect to their US server.

  • Quick Prototyping.

  • As Arduino boards are generally low-performance 8-bit devices, an upgrade path may be the now cheap and powerful ESP8266/ESP32 which have WiFi capabilities.
  • For USB emulations, a quick and cheap way is to use Arduino Micro (ATmega32U4-based) that have support in generic Arduino IDE. Advanced use can also be found.

See Also