OK -
- The cocktail names are stored in a Blocks List. The cocktail ingredients are also stored in a Blocks List, in sequence with the cocktail names. Each Item of a List has an index number, starting at 1 (Item 1) and currently ending at 21 (Item 21).
cocktail Index 1: AMF; Ingredients Index 1: Sour mix, gin, vodka, tequila, rum
cocktail Index 2: BGM; Ingredients Index 2: Creme de violette, gin, lemon juice
-
The procedure 'PopulateListView' combines the two Block Lists into one List View component that displays the info to the App User. The List View also has Index numbers (currently 1 to 21), same as the Block Lists.
-
When the App User selects a cocktail from the List View, the code 'knows' the Index number of the selection. For example, if the User selects "Double Strike", that's index number 8 - the code sends that number, the 'Selection Index', to the Arduino. The code also uses the Main Text of the List View selection (Main Text = Cocktail Name) to inform the User that the system is making the cocktail (Status) .
-
When the Arduino receives the selection index number as the variable 'state', the switch code runs the Mix procedure, sending it the ingredients required to make the cocktail. If the cocktail was made by hand the ingredient values would be in one of any traditional liquid measurements. In the USA that might be fluid ounces - so a "Double Strike" cocktail would be 1 1/2 oz Vodka, 1 oz Blue Curacao, 3/4 oz Cranberry Juice, 3/8 oz Lime Juice. These measures are approximated as the time in milliseconds required for the pump to pour it's ingredient.
So if you want to add another cocktail, you just update the Block Lists in the App and Add another 'case' in the Arduino Sketch. I would keep the cocktails in alphabetical order to make life easier for the User.

You can add a new item to a Block List in any position. Just make sure it's added in the same position in the Arduino Sketch.