Skip to content

Instantly share code, notes, and snippets.

@gfwilliams
Created January 19, 2021 15:37
Show Gist options
  • Save gfwilliams/a0a6e33aa85af2c6ca9e02c1b99ef6d5 to your computer and use it in GitHub Desktop.
Save gfwilliams/a0a6e33aa85af2c6ca9e02c1b99ef6d5 to your computer and use it in GitHub Desktop.
var boolean = false;
var number = 50;
// First menu
var mainmenu = {
"" : { "title" : "-- Main Menu --" },
"Backlight On" : function() { LED1.set(); },
"Backlight Off" : function() { LED1.reset(); },
"A Boolean" : {
value : boolean,
format : v => v?"On":"Off",
onchange : v => { boolean=v; }
},
"A Number" : {
value : number,
min:0,max:100,step:10,
onchange : v => { number=v; }
},
"Exit" : function() { E.showMenu(); }, // remove the menu
};
// Actually display the menu
E.showMenu(mainmenu);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment