Things used in this project

Hardware components:
R8326274 01
Raspberry Pi 2 Model B
×1
water pump
×1
Relay (generic)
8 channel
×1
pipe
×1
Adafruit touchscreen
×1
sd card
×1
Software apps and online services:
raspbian modified
putty
win 32 disk imager

Code

Code snippet #4Plain text
<p>#!/bin/bash<br> 
while true; do
  choice="$(zenity --width=400 --height=300 --list --column "" --title="Cocktail" \
  "cocktail" \
  "soft" \
   "shooter" \
   "cow boy")"
  
  echo $choice
 
  case "${choice}" in
    "cocktail" )
      while true; do
        choice="$(zenity --width=400 --height=300 --list --column "" --title="test" \
        "whisky coca" \
        "wodka orange" \
		"ricard eau" \
		"tequila orange"\
		"Gin orange")"
 
		echo $choice
		
        case "${choice}" in
          "whisky coca" )
            
  gpio mode 2 out
        sleep 3
        gpio mode 2 input \</p><p>        gpio mode 0 out
       sleep 4
       gpio mode 0 input
         </p><p>			break
          ;;
          "wodka orange" )
             gpio mode 3 out
        sleep 2
        gpio mode 3 input \</p><p>        gpio mode 7 out
       sleep 4
       gpio mode 7 input
         
			break
          ;;
		  "ricard eau" )
             gpio mode 24 out
        sleep 3
        gpio mode 24 input \</p><p>        gpio mode 25 out
       sleep 3
       gpio mode 25 input
         
			break
          ;;
		    
          "tequila orange" )
             gpio mode 22 out
        sleep 3
        gpio mode 22 input \</p><p>        gpio mode 7 out
       sleep 3
       gpio mode 7 input
         
			break
          ;;
		   "Gin orange" )
            gpio mode 23 out
        sleep 2
        gpio mode 23 input \</p><p>        gpio mode 7 out
       sleep 4
       gpio mode 7 input
         
			break
       ;;
		  *)
			echo "bye"
			break
		  ;;
        esac
      done
     ;;
	 "soft" )
		while true; do
        choice="$(zenity --width=400 --height=300 --list --column "" --title="test" \
        "orange" \
		"coca" \
        "eau")"
		
		echo $choice
 
        case "${choice}" in
          "orange" )
             gpio mode 7 out
       sleep 6
       gpio mode 7 input
			break
          ;;
          "coca" )
             gpio mode 0 out
       sleep 6
       gpio mode 0 input
			break
          ;;
		  
		   "eau" )
             gpio mode 25 out
       sleep 6
       gpio mode 25 input
			break
          ;;
		  *)
			echo "bye"
			break
		  ;;
		  esac
		  done
	 ;;
	
    
 "shooter" )
		while true; do
        choice="$(zenity --width=400 --height=300 --list --column "" --title="test" \
        "whisky" \
		"wodka" \
		"tequila" \
		"gin" \
        "TGV")" 
		
		echo $choice
 
        case "${choice}" in
          "whisky" )
             gpio mode 2 out
       sleep 2
       gpio mode 2 input
			break
          ;;
          "wodka" )
             gpio mode 3 out
       sleep 2
       gpio mode 3 input
			break
          ;;
		  "tequila" )
             gpio mode 22 out
       sleep 2
       gpio mode 22 input
			break
          ;;
		  "gin" )
             gpio mode 23 out
       sleep 2
       gpio mode 23 input
			break
          ;;
		  "TGV" )
               gpio mode 22 out
        sleep 1
        gpio mode 22 input \</p><p>        gpio mode 23 out
       sleep 1
       gpio mode 23 input \
	   
	   gpio mode 3 out
        sleep 1
        gpio mode 3 input 
			break
          ;;
		  *)
			echo "bye"
			break
		  ;;
		  esac
		  done
	 ;;</p><p> "cow boy" )
		while true; do
        choice="$(zenity --width=400 --height=300 --list --column "" --title="test" \
        "ricard pierre" \
		"whisky coca" \
		"wodka orange" \
		"gin orange" \
		"tequila orange" \
        "cimetière")"
		
		echo $choice
 
        case "${choice}" in
          "ricard pierre" )
             gpio mode 24 out
        sleep 4
        gpio mode 24 input \</p><p>        gpio mode 25 out
       sleep 5
       gpio mode 25 input
			break
          ;;
          "whisky coca" )
            gpio mode 2 out
        sleep 3
        gpio mode 2 input \</p><p>        gpio mode 0 out
       sleep 6
       gpio mode 0 input
			break
          ;;
		     "wodka orange" )
             gpio mode 3 out
        sleep 3
        gpio mode 3 input \</p><p>        gpio mode 7 out
       sleep 6
       gpio mode 7 input
			break
          ;;
		     "gin orange" )
             gpio mode 23 out
        sleep 3
        gpio mode 23 input \</p><p>        gpio mode 7 out
       sleep 6
       gpio mode 7 input
			break
          ;;
		      "tequila orange" )
             gpio mode 22 out
        sleep 3
        gpio mode 22 input \</p><p>        gpio mode 7 out
       sleep 6
       gpio mode 7 input
			break
          ;;
		        "cimetière" )
             gpio mode 2 out
        sleep 2
        gpio mode 2 input \</p><p>        gpio mode 3 out
       sleep 2
       gpio mode 3 input \
	   
	    gpio mode 23 out
        sleep 2
        gpio mode 23 input \</p><p>        gpio mode 25 out
       sleep 2
       gpio mode 25 input \
	   
	   gpio mode 7 out
       sleep 1
       gpio mode 7 input
			break
          ;;
		  *)
			echo "bye"
			break
		  ;;
		  esac
		  done
	 ;;
	 *)
	  echo "bye"
	  break
    ;;
esac
done</p>

Credits

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Raspberry Pi Motion Tracking Gun Turret
Intermediate
  • 828
  • 13

Full instructions

A motion tracking airsoft or Nerf gun turret with autonomous and manual operation modes, controlled by a Raspberry Pi.

Reducing Arduino Power Consumption
Intermediate
  • 144
  • 5

Full instructions

One the most important feature of portable electronics should be long battery life. We can reduce the current drawn by several ways.

Particle Photon Based Security System with Alerting
Intermediate
  • 1,345
  • 20

Full instructions

Be alerted to any door or window opening and closing in your house on your smart phone.

Audio DAC HAT for Pi with Headphone Jack and 3W Speaker Out
Intermediate
  • 627
  • 3

Full instructions

Make your own DAC HAT for Raspberry Pi 3, Raspberry Pi Zero, Raspberry Pi Zero W that has a headphone jack and 3W stereo speaker out.

LoRaWAN for Raspberry Pi with Worldwide Frequency Support
Intermediate
  • 4,139
  • 18

Full instructions

LoRaWAN LMIC 1.6 for Raspberry Pi with Dragino LoRA/GPS HAT or standalone RFM95W LoRa Module.

Remote Lamp
Intermediate
  • 350
  • 4

Full instructions

How to make a lamp controlled by TV remote control.

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaFree StoreBlog