0% found this document useful (0 votes)
22 views12 pages

Include

The document describes an Arduino code for a beverage dispensing machine. It initializes an LCD screen and 4 buttons to select different drink flavors. When a button is pressed, it displays a message preparing and dispensing that drink by activating the corresponding motor for 10 seconds. It then displays a message that the drink is ready before returning to the drink selection screen.

Uploaded by

Jenny Ordoñez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views12 pages

Include

The document describes an Arduino code for a beverage dispensing machine. It initializes an LCD screen and 4 buttons to select different drink flavors. When a button is pressed, it displays a message preparing and dispensing that drink by activating the corresponding motor for 10 seconds. It then displays a message that the drink is ready before returning to the drink selection screen.

Uploaded by

Jenny Ordoñez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

#include<LiquidCrystal.

h> // biblioteca LCD 16x2

LiquidCrystal lcd(11,10,9,8,7,6);

int Boton1= 2;

int Boton2= 3;

int Boton3= 4;

int Boton4= 5;

int Motor1= A0;

int Motor2= A1;

int Motor3= A2;

int Motor4= A3;

void setup()

lcd.begin(16, 2);

lcd.setCursor(4,0);

lcd.print("Sabor de");

lcd.setCursor(5,1);

lcd.print("bebida:");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 1");

lcd.setCursor(5,1);

lcd.print("NARANJA");

delay(2000);
lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 2");

lcd.setCursor(6,1);

lcd.print("LIMON");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 3");

lcd.setCursor(7,1);

lcd.print("UVA");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 4");

lcd.setCursor(5,1);

lcd.print("MANZANA");

delay(2000);

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Presione un boton");

lcd.setCursor(1,1);

lcd.print("1:N 2:L 3:U 4:M");

delay(2000);

pinMode(Boton1, INPUT_PULLUP);

pinMode(Boton2, INPUT_PULLUP);

pinMode(Boton3, INPUT_PULLUP);
pinMode(Boton4, INPUT_PULLUP);

pinMode(Motor1, OUTPUT);

pinMode(Motor2, OUTPUT);

pinMode(Motor3, OUTPUT);

pinMode(Motor4, OUTPUT);

void loop()

if(digitalRead(Boton1)==0)// if(!digitalRead(Botao1))

lcd.clear();

lcd.setCursor(3,0);

lcd.print("Preparando:");

lcd.setCursor(5,1);

lcd.print("NARANJA");

delay(2000);

lcd.clear();

lcd.setCursor(3,0);

lcd.print("Aguarde un");

lcd.setCursor(5,1);

lcd.print("momento");

digitalWrite (Motor1, HIGH);

delay(10000);
digitalWrite (Motor1, LOW);

lcd.clear();

lcd.setCursor(1,0);

lcd.print("Bebida lista");

delay(5000);

lcd.clear();

lcd.setCursor(4,0);

lcd.print("Sabor de");

lcd.setCursor(5,1);

lcd.print("bebida:");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 1");

lcd.setCursor(5,1);

lcd.print("NARANJA");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 2");

lcd.setCursor(6,1);

lcd.print("LIMON");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 3");

lcd.setCursor(7,1);
lcd.print("UVA");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 4");

lcd.setCursor(5,1);

lcd.print("MANZANA");

delay(2000);

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Presione un boton");

lcd.setCursor(1,1);

lcd.print("1:N 2:L 3:U 4:M");

delay(2000);

if(digitalRead(Boton2)==0)// if(!digitalRead(Botao2))

lcd.clear();

lcd.setCursor(3,0);

lcd.print("Preparando:");

lcd.setCursor(6,1);

lcd.print("LIMON");

delay(2000);

lcd.clear();

lcd.setCursor(3,0);

lcd.print("Aguarde un");
lcd.setCursor(5,1);

lcd.print("momento");

digitalWrite (Motor2, HIGH);

delay(10000);

digitalWrite (Motor2, LOW);

lcd.clear();

lcd.setCursor(1,0);

lcd.print("Bebida lista");

delay(5000);

lcd.clear();

lcd.setCursor(4,0);

lcd.print("Sabor de");

lcd.setCursor(5,1);

lcd.print("bebida:");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 1");

lcd.setCursor(5,1);

lcd.print("NARANJA");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 2");

lcd.setCursor(6,1);

lcd.print("LIMON");

delay(2000);
lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 3");

lcd.setCursor(7,1);

lcd.print("UVA");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 4");

lcd.setCursor(5,1);

lcd.print("MANZANA");

delay(2000);

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Presione un boton");

lcd.setCursor(1,1);

lcd.print("1:N 2:L 3:U 4:M");

delay(2000);

if(digitalRead(Boton3)==0)// if(!digitalRead(Botao2))

lcd.clear();

lcd.setCursor(3,0);

lcd.print("Preparando:");

lcd.setCursor(7,1);

lcd.print("UVA");
delay(2000);

lcd.clear();

lcd.setCursor(3,0);

lcd.print("Aguarde un");

lcd.setCursor(5,1);

lcd.print("momento");

digitalWrite (Motor3, HIGH);

delay(10000);

digitalWrite (Motor3, LOW);

lcd.clear();

lcd.setCursor(1,0);

lcd.print("Bebida lista");

delay(5000);

lcd.clear();

lcd.setCursor(4,0);

lcd.print("Sabor de");

lcd.setCursor(5,1);

lcd.print("bebida:");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 1");

lcd.setCursor(5,1);

lcd.print("NARANJA");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);
lcd.print("Boton 2");

lcd.setCursor(6,1);

lcd.print("LIMON");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 3");

lcd.setCursor(7,1);

lcd.print("UVA");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 4");

lcd.setCursor(5,1);

lcd.print("MANZANA");

delay(2000);

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Presione un boton");

lcd.setCursor(1,1);

lcd.print("1:N 2:L 3:U 4:M");

delay(2000);

if(digitalRead(Boton4)==0)// if(!digitalRead(Botao2))

lcd.clear();
lcd.setCursor(3,0);

lcd.print("Preparando:");

lcd.setCursor(5,1);

lcd.print("MANZANA");

delay(2000);

lcd.clear();

lcd.setCursor(3,0);

lcd.print("Aguarde un");

lcd.setCursor(5,1);

lcd.print("momento");

digitalWrite (Motor4, HIGH);

delay(10000);

digitalWrite (Motor4, LOW);

lcd.clear();

lcd.setCursor(1,0);

lcd.print("Bebida lista");

delay(5000);

lcd.clear();

lcd.setCursor(4,0);

lcd.print("Sabor de");

lcd.setCursor(5,1);

lcd.print("bebida:");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 1");

lcd.setCursor(5,1);
lcd.print("NARANJA");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 2");

lcd.setCursor(6,1);

lcd.print("LIMON");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 3");

lcd.setCursor(7,1);

lcd.print("UVA");

delay(2000);

lcd.clear();

lcd.setCursor(5,0);

lcd.print("Boton 4");

lcd.setCursor(5,1);

lcd.print("MANZANA");

delay(2000);

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Presione un boton");

lcd.setCursor(1,1);

lcd.print("1:N 2:L 3:U 4:M");

delay(2000);

}
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy