' 'Barbot Program "Elixirator4" ' '2-11-12 ' ' 'Hardware I/O setup ' 'Solenoids (outputs) 'Output D.0,D.1,D.2,D.3,D.4 symbol sol0 = D.0 symbol sol1 = D.1 symbol sol2 = D.2 symbol sol3 = D.3 sertxd (" reset ") 'to signal a reset has occured 'Lights (outputs) 'Output D.4,D.5,D.6,D.7 symbol amber = D.4 'select symbol green = D.5 'start symbol red = D.6 'stop symbol blue = D.7 'top light 'Nixie output B.0,B.1,B.2,B.3 symbol drinknum = b0 'Buttons (inputs) 'input A.0,A.1,A.3 symbol sel = pinA.0 symbol startit = pinA.1 symbol stopit = pinA.3 'DAC setup (output) dacsetup %10100000 daclevel 0 scanbutton: 'scan buttons low amber if sel = 0 then nixie 'increment drink number on display if startit = 0 then makedrink 'make a drink if stopit = 0 then redlight 'stop the drink goto scanbutton nixie: 'nixie count high amber drinknum = drinknum + 1 if drinknum > 9 then gosub drinknum0 sertxd ("drinknum= ", #drinknum,13,10) pinsB = drinknum checkbutton: 'loop here to wait for button to release if sel = 1 then scanbutton goto checkbutton drinknum0: 'zero drinknum drinknum = 0 return makedrink: high green if drinknum = 0 then drink0 if drinknum = 1 then drink1 if drinknum = 2 then drink2 if drinknum = 3 then drink3 if drinknum = 4 then drink4 if drinknum = 5 then drink5 if drinknum = 6 then drink6 if drinknum = 7 then drink7 if drinknum = 8 then drink8 if drinknum = 9 then drink9 goto scanbutton redlight: ' emergency stop high red low blue low green low sol0 low sol1 low sol2 low sol3 daclevel 0 pause 2000 low red goto scanbutton drink0: 'Vodka shot 'b1=19 for 1 ounce 'bottle 1 Vodka high blue 'turn on air pump high green pause 1000 'pump it up high sol0 for b1 = 1 to 28 b2 = b1 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol0 low blue daclevel 0 pause 2000 low green goto scanbutton drink1: 'Tequila shot 'b1=19 for 1 ounce 'bottle 2 Tequila high blue 'turn on air pump high green pause 1000 'pump it up high sol1 for b1 = 1 to 28 b2 = b1 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol1 low blue daclevel 0 pause 2000 low green goto scanbutton drink2: 'Southren Comfort shot 'b1=19 for 1 ounce 'bottle 2 Southren Comfort high blue 'turn on air pump high green pause 1000 'pump it up high sol2 for b1 = 1 to 30 '1 3/4 oz b2 = b1 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol2 low blue daclevel 0 pause 2000 low green goto scanbutton drink3: 'Cranberry-Pomogranete serving 'b1=19 for 1 ounce 'bottle 3 cranpomo mixer high blue 'turn on air pump high green pause 1000 'pump it up high sol3 for b1 = 1 to 57 '3 oz serving b2 = b1/2 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol3 low blue daclevel 0 pause 2000 low green goto scanbutton drink4: 'Vodka and Cranpomo (Cape cod) high blue 'turn on air pump high green pause 1000 'pump it up high sol0 for b1 = 1 to 29 '1.5 oz Vodka b2 = b1 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol0 daclevel 0 pause 2000 high sol3 'cranpomo for b1 = 1 to 57 '3 oz cranpomo b2 = b1/2 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol3 low blue daclevel 0 pause 2000 low green goto scanbutton drink5: 'Tequila and Cranpomo high blue 'turn on air pump high green pause 1000 'pump it up high sol1 'Tequila for b1 = 1 to 29 '1.5 oz Tequila b2 = b1 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol1 daclevel 0 pause 2000 high sol3 'cranpomo for b1 = 1 to 57 '3 oz cranpomo b2 = b1/2 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol3 low blue daclevel 0 pause 2000 low green goto scanbutton drink6: 'Southren Comfort and Cranpomo (Cranberry Comfort) high blue 'turn on air pump high green pause 1000 'pump it up high sol2 for b1 = 1 to 30 '1.75 oz Southren comfort b2 = b1 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol2 daclevel 0 pause 2000 high sol3 'cranpomo for b1 = 1 to 57 '3 oz cranpomo b2 = b1/2 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol3 low blue daclevel 0 pause 2000 low green goto scanbutton drink7: 'Vodka and Southren comfort high blue 'turn on air pump high green pause 1000 'pump it up high sol0 'Vodka for b1 = 1 to 28 '1.5 oz Vodka b2 = b1 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol0 daclevel 0 pause 2000 high sol2 'Southren Comfort for b1 = 1 to 10 '1/2 oz Southren Comfort b2 = b1 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol2 low blue daclevel 0 pause 2000 low green goto scanbutton drink8: high blue 'turn on air pump high green pause 1000 'pump it up high sol0 'Vodka for b1 = 1 to 14 '.75 oz Vodka b2 = b1 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol0 daclevel 0 pause 2000 high sol1 'Tequila for b1 = 1 to 10 '.5 oz Tequila b2 = b1 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol1 daclevel 0 pause 2000 high sol2 'Southren comfort for b1 = 1 to 10 '.5 oz Southren Comfort b2 = b1 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol2 daclevel 0 low blue pause 2000 low green goto scanbutton drink9: 'All ingredents Vodka,TQ,SO,Cranpomo high blue 'turn on air pump high green pause 1000 'pump it up high sol0 'Vodka for b1 = 1 to 10 '.5 oz Vodka b2 = b1 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol0 daclevel 0 pause 2000 high sol1 'Tequila for b1 = 1 to 10 '.5 oz Tequila b2 = b1 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol1 daclevel 0 pause 2000 high sol2 'Southren comfort for b1 = 1 to 10 '.5 oz Southren Comfort b2 = b1 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol2 daclevel 0 pause 2000 high sol3 'Cranpomo for b1 = 1 to 57 '3 oz Cranpomo b2 = b1/2 daclevel b2 pause 250 if stopit = 0 then redlight next b1 low sol3 daclevel 0 low blue pause 2000 low green goto scanbutton end