Open kapete23 opened 4 years ago
Hi!
For those you probably don't need a special menu for edit, (maybe) you can use text fields , there are some on examples, with a mask allowing only "01" (binary). Provided that you do the conversion from the string to binary on the handler function and set the string every time you read the info from the ports.
menu will call the handler function on every change... enable update events to have differentiated enter and update events if desired
char* constMEM binDigits MEMMODE="01";
char* constMEM binMask[] MEMMODE={binDigits};
char portX[]="00000000";
...
//add this field to menu
,EDIT("PortX",portX,binMask,doNothing,noEvent,noStyle)
replace the doNothing
by the name of your handler function and the noEvent
mask by enterEvent
please note that i'm not compiling this... so it may need a tweak
EDIT("PortX",portX,binMask,binConvFunc,enterEvent,noStyle)
add as many fields needed, you can reuse the binMask and can make them with different sizes (mask is cyclic) you can also opt to not have an handler function and instead use an option to do the conversions when pressed.
Hello Sir @neu-rah Can you help me? how to design the code to create a menu structure like this :
“Enter value” functions as combining pin name and value. Example, Pin A : B10101111. Next will be stored in the data array (char data [4] = {...}). “Show data” functions as reading data from (char data [4] = {...}) and displaying data in the next menu.
can we combine data sel and menu sel like the second menu above? Thanks.