Arduino에 디스플레이를 달아보자!

 

Arduino에서 간단하게 데이터를 디스플레이 할 수 있는 LCD를 달아 보려고 합니다.

 

LCD는 현대에서 제작된 것으로 HC16202입니다.

   - 5V 전원 공급

   - 화면 밝기 조정

   - 2 * 16 LCD

Arduino의 예제를 사용하려면 아래와 같이 배선되어야 합니다.


핀 속성 

 LCD Pin

 Arduino Pin 

 Power 5V

 pin 2

 5V

 GND

 pin 1

 GND

 LCD R/W

 pin 5

 GND

 LCD RS

 pin 4

 Digital 12

 LCD Enable

 pin 6 

 Digital 11

 LCD DB4

 pin 11

 Digital 5

 LCD DB5

 pin 12

 Digital 4

 LCD DB6

 pin 13

 Digital 3

 LCD DB7

 pin 14

 Digital 2

Arduino와 LCD 모듈의 배선이 끝나면, Arduino IDE에서 LCD용 Example소스를
Arduino에 다운로드하며 됩니다.

예제 : File > Example > LiquidCrystal > HelloWorld

코드는 아래와 같습니다.

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
}

배선과 펌웨어 다운로드가 완료되면 아래와 같이 Arduino가 실행되어 LCD에 HelloWorld예제가 실행됩니다.


Fritzing file : 

arduino_lcd.fzz


'IOE > Arduino' 카테고리의 다른 글

Arduino에 디스플레이(VFD)를 달아보자!  (0) 2013.12.07
Breakout.js를 이용한 Arduino 시작하기  (0) 2013.11.10
Posted by 혀나미
,

Raspberry Pi에 모니터와 키보드를 연결하지 않고 사용할 수 있도록 원격제어 시스템을 구성하였습니다.


원격제어를 위해서 VNC를 사용할 수 있습니다. 

Raspberry Pi에 사용할 수 있는 공개 VNC 서버와 Mac OS에서 사용할 수 있는 VNC 클라이언트를 소개합니다.


Raspberry Pi VNC 서버 : tightvncserver,  http://www.tightvnc.com

Mac OS VNC 클라이언트 : Checken of the VNC, http://sourceforge.net/projects/cotvnc/


[Raspberry Pi 서버 구성]

1. VNC 서버 설치하기

  $sudo apt-get install tightvncserver

  $vncserver

   서버 패스워드를 설정합니다.


2. 서버 실행관리 파일 생성

  /etc/init.d 폴더에 VNC 서버 실행을 위한 스크립트를 추가합니다.

 

  $cd /etc/init.d

  $sudo vi tightvncserver


#!/bin/bash

# /etc/init.d/tightvncserver

#


case "$1" in

start)

        sudo vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb565

        ;;

stop)

        sudo vncserver -kill :1

        ;;

restart)

        $0 stop

        $0 start

        ;;

esac


exit 0


3. 실행파일 실행권한 지정

  $sudo chmod +x tightvncserver

  $sudo pkill Xtightvnc


4. 서버 실행하기

  $sudo /etc/init.d/tightvncserver start

  $cd /etc/init.d

  $sudo update-rc.d tightvncserver defaults


 5. 시스템 리부팅시 자동 시작을 위해서 아래의 내용을 rc.local 에 추가합니다.

  $sudo vi /etc/rc.local


  ...중략...

# Startup VNC Server

/etc/init.d/tightvncserver start


exit 0


위 내용을 저장하고 나면 다음 부팅시 자동으로 VNC 서버가 실행됩니다.


[Mac OS에서 VNC 클라이언트 사용]

1. 아래의 Chicken of the VNC 프로그램 설치하고 실행한다.

cotvnc-20b4.dmg


2. 아래의 VNC Login 화면에서 Raspberry Pi VNC 서버로 접속할 수 있는 정보를 설정한다.

   Host : Raspberry Pi IP주소

   Display : vncserver 데몬 실행에서 설정한 디스플레이 번호(현재는 1번)

            ** tightvncserver 파일 내용참조

   Password : vncserver 실행시에 설정한 암호

나머지 내용은 기본값으로 하였다.



3. VNC서버 접속 설정이 끝나면 "Connect"를 누르고 서버로 접속한다.



이제 Raspberry Pi를 모니터, 키보드 연결이 없이 Mac OS환경에서 원격접속하여 마음대로 사용할 수 있다.


Macbook pro에서 Raspberry Pi로 접속하여 작업하는 화면, 

Raspberry Pi와는 무선으로 연결되어 있다.


참조, Pidora에서 설치하기

http://www.tecmint.com/install-tightvnc-remote-desktop/


Posted by 혀나미
,

Arduino에 디스플레이를 달아보자!

 

Arduino에서 간단하게 데이터를 디스플레이 할 수 있는 VFD(Vacuum Fluorescent Display)를 달아 보려고 합니다.

 

VFD는 삼성에서 제작된 것으로 16T202DA1E입니다.

   - HD44780 대체품 사용 가능.

   - 5V 전원 공급

   - 2 * 16 LCD

 

 

VFD 모듈의 Pinout은 아래와 같습니다.

16T202DA1E_vfd_pinout

Arduino의 예제를 사용하려면 아래와 같이 배선되어야 합니다.

핀 속성 

 VFD Pin

 Arduino Pin 

 Power 5V

 pin 2

 5V

 GND

 pin 1

 GND

 LCD RS

 pin 4

 Digital 12

 LCD Enable

 pin 6 

 Digital 11

 LCD DB4

 pin 11

 Digital 5

 LCD DB5

 pin 12

 Digital 4

 LCD DB6

 pin 13

 Digital 3

 LCD DB7

 pin 14

 Digital 2

 LCD R/W

 pin 5

 GND

Arduino와 VFD 모듈의 배선이 끝나면, Arduino IDE에서 VFD용 Example소스를
Arduino에 다운로드하며 됩니다.

예제 : File > Example > LiquidCrystal > HelloWorld

코드는 아래와 같습니다.

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
}

배선과 펌웨어 다운로드가 완료되면 아래와 같이 Arduino가 실행되어 VFD에 HelloWorld예제가 실행됩니다.

참조 사이트 : http://www.scienceprog.com/test-run-of-vfd-display-using-arduino/#more-5095

'IOE > Arduino' 카테고리의 다른 글

Arduino에 디스플레이(LCD)를 달아보자!  (0) 2014.01.04
Breakout.js를 이용한 Arduino 시작하기  (0) 2013.11.10
Posted by 혀나미
,