wiringPi를 이용한 led blink 테스트

1. wiringPi 설치

pi@was02 ~ $ sudo apt-get install git-core
pi@was02 ~ $
pi@was02 ~ $ git clone git://git.drogon.net/wiringPi
Cloning into ‘wiringPi’…
remote: Counting objects: 742, done.
remote: Compressing objects: 100% (676/676), done.
remote: Total 742 (delta 538), reused 94 (delta 58)
Receiving objects: 100% (742/742), 262.41 KiB | 127 KiB/s, done.
Resolving deltas: 100% (538/538), done.
pi@was02 ~ $
pi@was02 ~ $
pi@was02 ~ $ cd wiringPi
pi@was02 ~/wiringPi $ git pull origin
Already up-to-date.
pi@was02 ~/wiringPi $
pi@was02 ~/wiringPi $ ./build
wiringPi Build script
=====================

WiringPi Library
[UnInstall]
[Compile] wiringPi.c
[Compile] wiringSerial.c
[Compile] wiringShift.c
[Compile] piThread.c
[Compile] piHiPri.c
[Compile] wiringPiSPI.c
[Compile] wiringPiI2C.c
[Compile] softPwm.c
[Compile] softTone.c
[Compile] mcp23008.c
[Compile] mcp23016.c
[Compile] mcp23017.c
[Compile] mcp23s08.c
[Compile] mcp23s17.c
[Compile] sr595.c
[Compile] pcf8574.c
[Compile] pcf8591.c
[Compile] mcp3002.c
[Compile] mcp3004.c
[Compile] mcp4802.c
[Compile] mcp3422.c
[Compile] max31855.c
[Compile] max5322.c
[Compile] sn3218.c
[Compile] drcSerial.c
[Compile] wpiExtensions.c
[Link (Dynamic)]
[Install Headers]
[Install Dynamic Lib]

WiringPi Devices Library
[UnInstall]
[Compile] ds1302.c
[Compile] gertboard.c
[Compile] maxdetect.c
[Compile] piFace.c
[Compile] piNes.c
[Compile] lcd128x64.c
[Compile] lcd.c
[Compile] piGlow.c
[Link (Dynamic)]
[Install Headers]
[Install Dynamic Lib]

GPIO Utility
[Compile] gpio.c
[Compile] readall.c
[Compile] pins.c
[Link]
[Install]

All Done.

NOTE: To compile programs with wiringPi, you need to add:
-lwiringPi
to your compile line(s) To use the Gertboard, MaxDetect, etc.
code (the devLib), you need to also add:
-lwiringPiDev
to your compile line(s).

pi@was02 ~/wiringPi $

2. 설치확인  (아래와 같이 뜨면 잘 설치된 것임)
pi@was02 ~/wiringPi $ gpio -v
gpio version: 2.26
Copyright (c) 2012-2015 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
Type: Model B, Revision: 2, Memory: 512MB, Maker: Egoman
pi@was02 ~/wiringPi $
pi@was02 ~/wiringPi $ gpio readall

Cap 2015-07-05 11-07-43-180

3. 테스트 샘플 수행

pi@was02 ~/wiringPi $ cd examples
pi@was02 ~/wiringPi/examples $ gcc -Wall -o blink blink.c -lwiringPi  <– 컴파일
pi@was02 ~/wiringPi/examples $ sudo ./blink              <– 프로그램 수행시작
Raspberry Pi blink                                                       <– 프로그램 수행중
^Cpi@was02 ~/wiringPi/examples $                              <– Cntl + c 로 강제종료
pi@was02 ~/wiringPi/examples $

4. 회로구성
20150705_014916

5. 동작화면

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s