59Views1Replies

Author Options:

Question about calling arduino functions? Answered

So i'm messing with some 7-segment displays and i have a function for each number to display, right now I'm ending up using a ton of if statements to control which number's function is called based on a value, however I wondered if there was a way to output a number or value that would select the function

for instance the functions I'm using are named 0-9 so if I could have it setup in some way almost as if it were like this "(value)();" instead of the if statements to activate each function 

Tags:arduino

Comments

The forums are retiring in 2021 and are now closed for new topics and comments.
0
JakeWhelchel
JakeWhelchel

6 years ago

so i quickly realized i couldnt name functions like void 0();

but yea, so idk, is there maybe a way to load functions into an array or something?