Start a new topic

Radio Button Controls

I have imagined a page with 20 radio buttons. They represent 3 states each: ready and deactivated, activated and standby. READY has a green background. ACTIVATED has a yellow background with a red center dot. STANDBY has the yellow background (without the dot.) I envision ACTIVATING (via the MCU) a particular radio button with "xxx.val=1" and perhaps a light comes on somewhere via the MCU. I envision putting that activated radio button into STANDBY mode with a touch which takes its value to zero ("xxx.val=0") thus indicating that something has happened at this object, but it is no longer ACTIVATED. This is a function of the Nextion display. Then I envision creating a CLEAR message that resets the background to green and resets all values to zero ("xxx.val=0".) I can't see how to get this CLEAR function to work with ONLY all of the radio buttons (dynamic quantity) without any interference with other buttons that may be on the page. Is there a way for the MCU to know what buttons are on a page? I am not using an Arduino, and haven't exactly chosen an MCU yet. (Probably will be PICAXE based.)

First, Nextion Components are static quantity at runtime

- if you didn't add it into the HMI at design time, it does not exist at runtime

Radio Button is dual state, val is 0 or 1.

- this represents 2 of your three states, your extra bit needs to come from elsewhere

- wherever you are grabbing the extra bit, you must handle your logic.


The MCU statically knows what buttons are on a page, as this you included in source.

IF you do not provide such intel to your MCU, your MCU will not know.


"MCU statically knows what buttons ..."

Understood, but I was hoping to be able to add radio buttons in the Nextion without reprogramming the MCU. More thinking necessary.

 

Components within the Editor become records in the TFT.

There is no class, there is no dynamic creation.


There are gui commands that can give this illusion of dynamic

but a page refresh could easily wipe that out quickly

Login or Signup to post a comment