Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Cofre de Legoino

  • Lucaslândia
  • 2019-09-07
  • 189
Cofre de Legoino
legoarduinocofre
  • ok logo

Скачать Cofre de Legoino бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Cofre de Legoino или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Cofre de Legoino бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Cofre de Legoino

Cofre de Lego e Arduino.

Abaixo, o código para o Arduino:
(substitua os @ por hashes para rodar)

@include "Wire.h"
@include "Adafruit_SSD1306.h"
@include "Adafruit_GFX.h"
@include "Servo.h"

// OLED display TWI address
@define OLED_ADDR 0x3C
@define DIAL_PIN A6
@define BUTTON_PIN 6
@define SERVO_PIN 12
@define CHAR_W 12
@define CHAR_H 16

int cursor;
int senha;
char strSenha[4];
int segredo;
bool aberto;
Servo tranca;

Adafruit_SSD1306 display(-1);

@if (SSD1306_LCDHEIGHT != 64)
@error("Height err");
@endif

void inicia()
{
display.clearDisplay();
display.display();
printXY(0,2,"DIGITE A SENHA");
cursor=0;
senha=0;
printXY(0,0,"****");
}

void printXY(int x, int y, String txt)
{
display.setCursor(x*CHAR_W,y*CHAR_H);
display.print(txt);
display.display();
}

void printXYn(int x, int y, int n)
{
display.fillRect(x*CHAR_W,y*CHAR_H,CHAR_W,CHAR_H,BLACK);
display.setCursor(x*CHAR_W,y*CHAR_H);
display.print(n);
display.display();
}

void setup() {

// initialize and clear display (no tamanho 2, 16 de altura e 10 chars por linha, começando do zero)
display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR);
display.setTextSize(2);
display.setTextColor(WHITE);
display.clearDisplay();
display.display();

segredo=1357; // ** coloque sua senha aqui ***
aberto=false;
tranca.attach(SERVO_PIN);
tranca.write(0);
Serial.begin(9600);
inicia();
}


void loop()
{
int dial;
bool botao;

if (!aberto)
{
dial=trunc(9-analogRead(DIAL_PIN)/110);
botao=digitalRead(BUTTON_PIN);
printXYn(8,0,dial);
if (botao==LOW)
{
Serial.println(dial);
senha=senha*10+dial;
printXYn(cursor,0,dial);
cursor=cursor+1;
delay(500);
if (cursor==4)
{
if (senha==segredo)
{
display.clearDisplay();
printXY(0,0,"Abrindo...");
tranca.write(180);
delay(2000);
aberto=true;
}
else // senha diferente de segredo
{
display.clearDisplay();
printXY(0,0,"INCORRETO!");
printXY(0,2,"Tente novamente.");
delay(5000);
inicia();
}
} // cursor==4
} // botao==HIGH
}
else // fechado
{
display.clearDisplay();
printXY(0,0,"ABERTO");
printXY(0,1,"Pressione p/ fechar.");
do
{
botao=digitalRead(BUTTON_PIN);
} while (botao==HIGH);
display.clearDisplay();
printXY(0,0,"Fechando ...");
tranca.write(0);
delay(2000);
aberto=false;
inicia();
} // aberto
delay(10);
}

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]