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
Knowledge | Level |
---|---|
Matlab | ⭐ |
Simulink | ⭐⭐ |
Stateflow | ⭐⭐⭐ |
Note: We recommend completing the Getting Started with Simulink Coder Support Package for STMicroelectronics Nucleo Boards example.
- Supported STMicroelectronics Nucleo board
- USB cable type A to Mini-B cable
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.
- 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.
- 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.
This section shows the main steps I followed to achieve the goal.
- Simulink onramp
- Stateflow onramp
- Simulink Coder Support Package Using STMicroelectronics Nucleo Boards
- Simulink-Stateflow implementation of the Gear Logic
- Implementing the LED bliking logic
- 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.