Skip to content

A State-Controlled Gear selection with a LED feedback powered by STM32 Nucleo

License

Notifications You must be signed in to change notification settings

icub-tech-iit/training-matlab-rev-lights

Repository files navigation

Training Project on Implementing a State-Controlled Gear selection with a LED feedback powered by STM32 Nucleo

This repository consists of folders containing the MATLAB and Simulink files based on the following examples and projects:

LED_feedback_on_stm32_button.mov

Prerequisites

Knowledge Level
Matlab
Simulink ⭐⭐
Stateflow ⭐⭐⭐

Note: We recommend completing the Getting Started with Simulink Coder Support Package for STMicroelectronics Nucleo Boards example.

Required Hardware

  • Supported STMicroelectronics Nucleo board
  • USB cable type A to Mini-B cable

The goal 🎯

The purpose of this project is learn how to combine Simulink, and Stateflow and how we cane use them to control a gear selection system with a LED feedback coming from a NUCLEO-L476RG board.

Tasks

  • Implement a simplified State-Controlled Four-Gear Selection based on the Automatic Transmission Controller example.
  • Each time a gear is scaled up/down the LED should blink once.
  • Once the the system reaches the last gear and the engine is revving, the LED should blink quickly.

Optionals:

  • The intensity of main LED (PIN 13) should be managed proportionaly to the current gear selected.
  • If you own an RGB LED stripe you can use it instead of the main LED.

Main Flow

This section shows the main steps I followed to achieve the goal.

Learn


Code

  1. Simulink-Stateflow implementation of the Gear Logic
  2. Implementing the LED bliking logic
  3. Code generation and deployment on STM32 Nucleo

Note:

  • Each folder contains a README that shows the main work of the relative step.
  • All the sources in this repository have been tested on Matlab R2021a.