산업 제조
산업용 사물 인터넷 | 산업자재 | 장비 유지 보수 및 수리 | 산업 프로그래밍 |
home  MfgRobots >> 산업 제조 >  >> Manufacturing Technology >> 제조공정

AI LCD 동반자 만들기: 인터랙티브 버디 '로비'

부품 및 소모품

아두이노 우노 (Arduino UNO) 1개
로터리 포텐셔미터 (일반) 1개
점퍼 와이어 (일반) 19개
브레드보드 (일반) 1개
버튼 4개
저항 100옴 3개
저항 221옴 1개
Adafruit 표준 LCD 16x2 (흰색/파란색) 1개

앱 및 온라인 서비스

프로젝트 소개

외로운 시간을 함께할 버디를 만들어보세요.

코드

전체 코드 (C/C++)

확장하고 싶다면 주석에 코드를 남겨주세요! "to be continued." 뒤에 복사해 넣으면 됩니다.

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int buttonPin = 9;
int buttonState = 0;
const int buttonPin2 = 10;
const int buttonPin3 = 8;

void setup() {
  pinMode(buttonPin, INPUT);
  pinMode(buttonPin2, INPUT);
  pinMode(buttonPin3, INPUT);
  lcd.begin(16, 2);
  
  // 시작 인사 시퀀스
  lcd.print(" (.) (.) Hi I");
  lcd.setCursor(2, 2);
  lcd.print("(____) am Robi");
  delay(2000);
  lcd.clear();
  lcd.print(" (.) (.) You ");
  lcd.setCursor(2, 2);
  lcd.print(" ____ can talk");
  delay(2000);
  lcd.clear();
  lcd.print(" (-) (-) to ");
  lcd.setCursor(2, 2);
  lcd.print(" (____) me!");
  delay(2000);
  lcd.clear();
  lcd.print(" (.) (.)Tap");
  lcd.setCursor(2, 2);
  lcd.print(" ____ the");
  delay(2000);
  lcd.clear();
  lcd.print(" (.) (.) but");
  lcd.setCursor(2, 2);
  lcd.print(" (____) ton");
  delay(2000);
}

void loop() {
  // 버튼 1: 알렉산더 모드
  buttonState = digitalRead(buttonPin);
  if (buttonState == HIGH) {
    lcd.clear(); lcd.print("Hello I am"); lcd.setCursor(2, 2); lcd.print("Alexander"); delay(2000);
    lcd.clear(); lcd.print(" (*) (*) Hi!"); lcd.setCursor(2, 2); lcd.print(" (____)"); delay(2000);
    lcd.clear(); lcd.print(" (.) (.)Let's"); lcd.setCursor(2, 2); lcd.print(" ____ play"); delay(2000);
    lcd.clear(); lcd.print("OK!"); lcd.setCursor(2, 2); lcd.print(" But Where?"); delay(2000);
    lcd.clear(); lcd.print(" (.) (.) Park"); lcd.setCursor(2, 2); lcd.print(" (____)or home?"); delay(2000);
    lcd.clear(); lcd.print("Left = Park"); lcd.setCursor(2, 2); lcd.print("Right = Home"); delay(2000);
  }

  // 버튼 2: 공원 가기 시나리오
  buttonState = digitalRead(buttonPin2);
  if (buttonState == HIGH) {
    lcd.clear(); lcd.print("You go to"); lcd.setCursor(2, 2); lcd.print("the Park..."); delay(2000);
    lcd.clear(); lcd.print(" (.) (.) Lets"); lcd.setCursor(2, 2); lcd.print(" ____ swing!"); delay(2000);
    lcd.clear(); lcd.print("OK!"); lcd.setCursor(2, 2); lcd.print("You swing..."); delay(2000);
    lcd.clear(); lcd.print(" (*) (*) I'm"); lcd.setCursor(2, 2); lcd.print(" (___) tired"); delay(2000);
    lcd.clear(); lcd.print("Me too!"); lcd.setCursor(2, 2); lcd.print("Lets drink."); delay(2000);
    lcd.clear(); lcd.print(" (.) (.) Yeah"); lcd.setCursor(2, 2); lcd.print(" (____) "); delay(2000);
    lcd.clear(); lcd.print("You go buy"); lcd.setCursor(2, 2); lcd.print("a drink..."); delay(2000);
    lcd.clear(); lcd.print(" (*) (*) Ahh!"); lcd.setCursor(2, 2); lcd.print(" ____ OW!!"); delay(2000);
    lcd.clear(); lcd.print("What?"); lcd.setCursor(2, 2); lcd.print("..."); delay(2000);
    lcd.clear(); lcd.print(" (*) (*)Water"); lcd.setCursor(2, 2); lcd.print(" []got in my eye"); delay(2000);
    lcd.clear(); lcd.print("To be "); lcd.setCursor(2, 2); lcd.print("continued."); delay(2000);
  }

  // 버튼 3: 집 가기 시나리오
  buttonState = digitalRead(buttonPin3);
  if (buttonState == HIGH) {
    lcd.clear(); lcd.print("You go to"); lcd.setCursor(2, 2); lcd.print("your home..."); delay(2000);
    lcd.clear(); lcd.print(" (.) (.) WOW!"); lcd.setCursor(2, 2); lcd.print(" ___ Cool!"); delay(2000);
    lcd.clear(); lcd.print("You play for"); lcd.setCursor(2, 2); lcd.print("the day..."); delay(2000);
    lcd.clear(); lcd.print("To be"); lcd.setCursor(2, 2); lcd.print("continued."); delay(2000);
    lcd.clear();
  }
}

회로도

AI LCD 동반자 만들기: 인터랙티브 버디  로비

제조공정

  1. 아두이노 우노 & MAX7219로 만드는 UFO 어택 게임 – 직접 만드는 레트로 아케이드
  2. 아두이노 나노와 노키아 5110 LCD로 20kHz 오실로스코프 만들기: 쉬운 DIY 가이드
  3. 스마트 블라인드: 아두이노와 태양광으로 자동 조명 제어
  4. 3D RGB 아두클락(Arduclock) - 블루투스 제어 LED 타임피스 with RTC
  5. 강 건강 모니터: 아두이노 기반 수질 측정 시스템
  6. 아두이노로 간단한 장애물 센서 만들기 - IR LED & 포토다이오드 튜토리얼
  7. 아두이노 조이스틱 인터랙티브 게임 - LED 피드백으로 방향 감지
  8. 아두이노와 블루투스로 만드는 스마트 물건 찾기 'Find Me'
  9. 아두이노 나노 DIY 오실로스코프 (10Hz~50kHz, 128x64 LCD)
  10. 아두이노로 만드는 소형 자율 주행 로버