Está en la página 1de 5

Taller Informe Arduino Thinkercad

Presentado A

Diego Salcedo

Aprendiz

Santiago Arboleda

CDITI SENA

Risaralda, Dosquebradas

30 De Abril del 2020

Arduino

1824452
En este circuito básicamente SE DEDINEN TIEMPOS, en void loop se definia esta función Millis
como entrada y básicamente lo que se hacia era un salto de tres segundos donde se enciende el
LED1 y seguira encendido hasta los tres segundos posteriores, en el segundo seis se apagara hasta
que llegue al segundo 9 y así sucesivamente . Definiendo con un digitalwrite el encendido y el
apagado (HIGH y LOW).

CODIGO:

unsigned long tiempo1 = 0;

unsigned long tiempo2 = 0;

unsigned long tiempo3 = 0;

unsigned long tiempo4 = 0;

unsigned long tiempoSegundos = 0;

unsigned long tiempoSegundos1 = 0;

int led1 =3;

void setup() {

Serial.begin(9600);

tiempo1 = millis();

pinMode(led1, OUTPUT);

void loop() {
tiempo2 = millis();

if(tiempo2 > (tiempo1+3000)){ //Si ha pasado 1 segundo ejecuta el IF

tiempo1 = millis(); //Actualiza el tiempo actual

tiempoSegundos = tiempo1/3000;

digitalWrite(led1, HIGH);

tiempo4 = millis();

if(tiempo4 > (tiempo3+6000)){ //Si ha pasado 1 segundo ejecuta el IF

tiempo3 = millis(); //Actualiza el tiempo actual

tiempoSegundos1 = tiempo3/6000;

digitalWrite(led1, LOW);

//Serial.print("Ha transcurrido: ");

Serial.print("led1");

Serial.print(tiempoSegundos);

Serial.println(" desde que se encendio el Arduino");

LINK: https://www.tinkercad.com/things/baAah0IJmcF-1-led/editel?sharecode=aU7-
xMsfEP2HNfWQaRFvEYo4i3h0l7YccDL575OJBL0
EJEMPLO 1

Se ejecuto correctamente el código.

CODIGO:

unsigned long tiempo1 = 0;

unsigned long tiempo2 = 0;

unsigned long tiempoSegundos = 0;

void setup() {

Serial.begin(9600);

tiempo1 = millis();

void loop() {

tiempo2 = millis();

if(tiempo2 > (tiempo1+1000)){ //Si ha pasado 1 segundo ejecuta el IF


tiempo1 = millis(); //Actualiza el tiempo actual

tiempoSegundos = tiempo1/1000;

Serial.print("Ha transcurrido: ");

Serial.print(tiempoSegundos);

Serial.println(" desde que se encendio el Arduino");

LINK: https://www.tinkercad.com/things/6Z8vjDniS6m-sizzling-snaget/editel?tenant=circuits?
sharecode=PuSrt8i8qA3ICTiE4DcP3vqtdPJVtkCbfEX9OhlhMic

También podría gustarte