Question about writing C code for an arduino atmega328p:
How could I simplify this code without using so many if statements? Is there some way to use a look-up-table, or another technique that will speed up the process in a time-sensitive setting?
EX:
///////////////////
value = 'f';
if (value == 'a')
do something;
if (value == 'b')
do something;
if (value == 'c')
do something;
if (value == 'd')
do something;
if (value == 'e')
do something;
if (value == 'f')
do something;
if (value == 'g')
do something;
if (value == 'h')
do something;
//////////////////
"value" would be a variable letter that can be 'a' thru 'h'.
This seems like the quickest way (that I'm aware of), but also seems redundant. I'm new to this so I appreciate the help.