You are on page 1of 6

UNIVERSIDAD CATLICA DE CUENCA

UNIDAD ACADMICA DE INGENIERA DE SISTEMAS,


ELCTRICA Y ELECTRNICA
FACULTAD DE INGENIERA ELECTRNICA

4to Electrnica.

Informe
Diseo de Entrenador de Arduino















PROGRAMACION Y FUNCIONAMIENTO
LED Y PULSANTE
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);



// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}






ENSOR Y LCD
#include <LiquidCrystal.h>
int p1= 7;
int p2=8;
int p3=9;


int p4=10;
int variable=0;
int variable1=0;
int variable2=0;
int variable3=0;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
double temp;
void setup() {
pinMode(p1, INPUT);
pinMode(p2, INPUT);
pinMode(p3, INPUT);
pinMode(p4, INPUT);
Serial.begin(9600);
lcd.begin(16, 2);
}
void loop() {
variable = digitalRead(p1);
variable1= digitalRead(p2);
variable2= digitalRead(p3);
variable3= digitalRead(p4);
temp =
(analogRead(A1)*500.0)/1023.0;
lcd.setCursor(0,0);
lcd.print("Temp:");
lcd.print(temp);
lcd.write(byte(0));
lcd.print("C");
lcd.setCursor(0,1);
lcd.print("presentacion ");
delay(200);

if(variable==0)
{
lcd.setCursor(1,1);
lcd.print(1);
delay(100);
}
if(variable==1)
{
lcd.setCursor(1,1);
lcd.print('_');
delay(100);
}
if(variable1==0)
{
lcd.setCursor(2,1);
lcd.print('_');
delay(100);
}
if(variable1==1){
lcd.setCursor(2,1);
lcd.print('_');
delay(100);
}


if(variable2==1){
lcd.setCursor(3,1);
lcd.print('_');
delay(100);
}
if(variable2==0)
{
lcd.setCursor(3,1);
lcd.print('_');
delay(100);
}
if(variable3==1)
{
lcd.setCursor(4,1);
lcd.print('_');
delay(100);
}
if(variable3==0)
{
lcd.setCursor(4,1);
lcd.print('_');
delay(100);
}
}

CONCLUCIONES
Se presenta como una solucin a muchos de los problemas de aprendizaje e
interaccin del alumno con la tecnologa. El motivo que llevan a creer que a partir de
una plataforma pre-armada pueda ser ms sencillo aprender

You might also like