I'm trying to create the menu in a display linked to arduino by inserting the elements inside an array like the one below in pseudo-code (javascript).
var menu = {
title: 'main menu',
item: [{
txt: 'item1',
action: function() { // function that will be performed in case such an element is activated
// my code
}
},
{
txt: 'item2',
item: [{
txt: 'item4',
action: function() {
// my code
}
},
{
txt: 'item5',
action: function() {
// my code
}
}
],
action: function() {
// my code
}
},
{
txt: 'item3',
action: function() {
// my code
}
}
]
};
Later this array will be read by a recursive function that will print the menu on the liquid crystal display.
How can i do this to arduino? Using javascript seems like an operation at anyone's reach, but can you do the same in C / C ++?
Thanks to everyone in advance for the help!