Hi All,
I believe many of us needed to make an application that, in fact, does some basic things:
- Get input from a user
- Collect data from other sources like sensors
- Process the information and display the results based on the data captured and/or user input provided
- Rinse and Repeat
I 've made a working prototype of a sort-of MVC pattern for Arduino / STM32 which could help with such scenarios. It has been designed to split relevant operations into three domains - Data, Control and Presentation (yes, it is not a true canonical MVC, but I hope you see an analogy here) so there are three classes in the prototype. Together with the sketch itself, it helps to decouple functions that the code performs and make easier to manage and modify the code in future. The solution overview diagram is here.
In this prototype we can:
- simulate a signal from an external sensor with a variable potentiometer (Maple Mini converts an analog read to a value from 0 to 4095 which is called "voltage" in this prototype)
- capture user input with buttons (one built-in and a couple extra ones)
- display various screens and data on a small LCD display
- and also use Serial and built-in LED to provide output to users
See https://github.com/i998/Arduino_MVC_STM32
Hope that helps.
Prototype for sort-of MVC pattern for Arduino / STM32
Post here all questions related to LibMaple core if you can't find a relevant section!
Return to “General discussion”
Jump to
- Announcements
- New users start here
- ↳ Forum rules, FAQs and HowTo's
- ↳ Let us know a bit about you and your projects
- Arduino for STM32
- ↳ General discussion
- ↳ Ideas & suggestions
- ↳ Cores
- ↳ STM32 Core
- ↳ Builds and Announcements
- ↳ Code snippets
- ↳ Ideas & suggestions
- ↳ General discussion
- ↳ Installation and OS related
- ↳ Libraries & Hardware
- ↳ PR's bugs and enhancements
- ↳ LibMaple
- ↳ Builds and Announcements
- ↳ Code snippets
- ↳ General discussion
- ↳ Ideas & suggestions
- ↳ Installation and OS related
- ↳ Libraries & Hardware
- ↳ PR's bugs and enhancements
- ↳ Steve's LibMaple core
- ↳ General discussion
- ↳ PR's bugs and enhancements
- ↳ Projects
- ↳ IDE's
- ↳ Off topic
- Arduino for STM8
- ↳ General discussion
- ↳ Cores
- ↳ STM8 Core
- ↳ Other
- Boards
- ↳ Custom design boards
- ↳ Maple & Maple mini etc
- ↳ STM boards (Discovery, Eval, Nucleo, ...)
- ↳ All other boards
- ↳ STM32F0 based boards
- ↳ STM32F1 based boards
- ↳ STM32F2 based boards
- ↳ STM32F3 based boards
- ↳ STM32F4 based boards
- ↳ STM32F7 based boards
- ↳ STM32G0 based boards
- ↳ STM32G4 based boards
- ↳ STM32H7 based boards
- ↳ STM32L0 based boards
- ↳ STM32L1 based boards
- ↳ STM32L4 based boards
- ↳ STM32L5 based boards
- ↳ STM32MP1 based boards
- ↳ STM32WB based boards
- Bootloaders
- ↳ STM32 HID bootloader
- ↳ USB bootloader
- ↳ STM32 SD-Bootloader
- ↳ STM32 USB CDC bootloader
- Uploaders and debuggers
- ↳ STLink
- ↳ USB to Serial adaptors
- ↳ Black Magic Probe & other
- Dead Thread Graveyard
- ↳ Dead Thread Graveyard