I tried this code to edit same number with steps of 10, 1 or 0.1 but when I edit number e.g. in "number x10" menu, that value it not updated to other menus. How can I fix this?
var number = 50.0;
var menu = {
"" : { "title" : "-- Menu --" },
"number x10" : {
value : number,
format: v => v.toFixed(1),
step: 10,
onchange : v => { number=v; }
},
"number x1" : {
value : number,
format: v => v.toFixed(1),
step: 1,
onchange : v => { number=v; }
},
"number x0.1" : {
value : number,
format: v => v.toFixed(1),
step: 0.1,
onchange : v => { number=v; }
},
"Exit" : function() { E.showMenu(); },
};
E.showMenu(menu);
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I tried this code to edit same number with steps of 10, 1 or 0.1 but when I edit number e.g. in "number x10" menu, that value it not updated to other menus. How can I fix this?