I'm basically looking for Arduino to take a bunch of numbers from Processing and convert them into actions.
So, currently 4 accounts that output 4 numbers, formatted from Processing like this 'Account1 0, Account2 0, Account3 0, Account4 0'.
The numbers are between 0 to 18. The higher the number is, the longer the action will go on for.
When I serial.write() the account and numbers to the Arduino, the sketch will through a bunch of if statements like:
if (incomingData == Account1, 3){
do something for 3000ms
}
if (incomingData == Account2, 16){
do something else for 16000ms
}
if (incomingData == Account3, 5){
do something else for 5000ms
}
if (incomingData == Account4, 0){
don't do anything
}
}
This could get messy and long and I'm sure theres a better way of going about this.
Any help?