cancel
Showing results for 
Search instead for 
Did you mean: 

Managing a rotary encoder.

SCass
Associate

Hi all,

I'm using touchgfx with stm32f769 in a board with hardware buttons and hardware knob (rotary encoder). I have more screens and the knob is used to change values that are different for every screen. Is there an example on how I can implement in the proper way the MVP software?

Thank you 

Best regards

Stefano Casson

2 REPLIES 2
Martin KJELDSEN
Chief III

Hi Stefano,

Check out one of the stickies in this subforum on how to integrate data from hardware peripherals into your application. There's an article with examples and a link (youtube) to a webinar i did on the subject. Let me know if that's not enough and i'll guide you some more.

/Martin

Martin KJELDSEN
Chief III

Here's the link: https://community.st.com/s/question/0D50X0000AU4zodSQB/interfacing-with-hardware-in-touchgfx-applications

In a nutshell:

  1. Create an OS task to sample your knobs and buttons. Use an OS message queue to send updated data if any.
  2. in Model::tick(), in your GUI Application task, check message queue for new data.
  3. Depending on the type of data, notify current presenter through ModelListener interface that some value changed.
  4. Presenter, if interested, takes that data and has its view update widgets and thus the resulting screen which is then transferred to the display.