Working on an Arduino project and could use some help on how to accomplish my needs..
A barcode will be scanned and depending on what it is, the value of 4 variables need to be set and no mathematical formula is possible to determine them..
This is just a "generic" textual example with 3 different barcodes.. but I could have hundreds.
I know I will have to somehow define what A,B,C,D will be for each word but know there must be a better way than hundreds of if statements.. maybe not
A barcode will be scanned and depending on what it is, the value of 4 variables need to be set and no mathematical formula is possible to determine them..
This is just a "generic" textual example with 3 different barcodes.. but I could have hundreds.
I know I will have to somehow define what A,B,C,D will be for each word but know there must be a better way than hundreds of if statements.. maybe not
Code:
IF barcode is "apple"
then
A=1
B=2
C=3
D=4
IF barcode is "pickle"
then
A=3
B=2
C=4
D=1
IF barcode is "dog"
then
A=2
B=3
C=1
D=4