์ƒˆ์†Œ์‹

๐Ÿ‡ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด

๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด GPIO ์‚ฌ์šฉํ•˜๊ธฐ - git git-core( wiringPi ๋‹ค์šด ์—๋Ÿฌ)

  • -

GPIO๋ž€  General-purpose input/output์˜ ์•ฝ์ž์ž…๋‹ˆ๋‹ค. (์ด ํ•€์„ํ†ตํ•ด ์ž…์ถœ๋ ฅ ์‹ ํ˜ธ, ํšŒ๋กœ์˜ ํ–‰๋™์ œ์–ด๊ฐ€ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.)

๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์—๋Š” 40๊ฐœ์˜ ํ•€๋“ค์ด ์žˆ๋Š”๋ฐ์š”, ๊ฐ๊ฐ์˜ ํ•€์€ ๋‹ค๋ฅธ ์—ญํ• ์„ ์ˆ˜ํ–‰ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

ํ—ค๋” ํ•€๋งต

์œ„์˜ ํ•€๋งต์€ ๋ผ์ฆˆ๋ฒ ๋ฆฌ๋ฅผ ์ด๋ ‡๊ฒŒ ๋†“๊ณ  ๋ณด์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. (USBํฌํŠธ๊ฐ€ ๋ฐ‘์œผ๋กœ ๋‚ด๋ ค๊ฐ€๋„๋ก)

 

GPOI๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๋ฉด, ์—ฌ๋Ÿฌ๊ฐ€์ง€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์žˆ์ง€๋งŒ C์–ธ์–ด๋ฅผ ์ด์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” wiringPi๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.


                               wiringPi ์„ค์น˜ (์˜ค๋ฅ˜๋ฐฉ๋ฒ• ํ•ด๊ฒฐ) 

์•„๋ž˜ ๊ตต์€๊ธ€์”จ๋ฅผ ํ„ฐ๋ฏธ๋„์ฐฝ์—์„œ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

sudo apt-get install git-core   (๊นƒ ์†Œ์Šค๊ด€๋ฆฌํˆด ๋‹ค์šด๋กœ๋“œ)

๋‹ค์Œ์€ git์—์„œ wiringPi๋ฅผ ๋‹ค์šด๋ฐ›์•„์ค๋‹ˆ๋‹ค.

git clone git://git.drogon.net/wiringPi     ์ธํ„ฐ๋„ท์—๋Š” ์ด ์ฃผ์†Œ๋กœ ๋˜์–ด์žˆ๋Š” ๊ธ€์ด ๋งŽ์•„์„œ ์• ๋จน์—ˆ์Šต๋‹ˆ๋‹ค. ์ž๊พธ ์—ฐ๊ฒฐ์˜ค๋ฅ˜๊ฐ€

๋ฐœ์ƒํ•˜๋”๊ตฐ์š”.... (unable to connect to git.drogon.net )

์—ฐ๊ฒฐ ์˜ค๋ฅ˜ ๋ฐœ์ƒ

git clone https://github.com/WiringPi/WiringPi

 

WiringPi/WiringPi

Gordon's Arduino wiring-like WiringPi Library for the Raspberry Pi (Unofficial Mirror for WiringPi bindings) - WiringPi/WiringPi

github.com

์œ„์˜ ์ฃผ์†Œ๋กœ ํ•˜๋‹ˆ ํ•ด๊ฒฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. 

 

 

 

cd WiringPi

 

WiringPi ๋””๋ ‰ํ„ฐ๋ฆฌ์— ๋“ค์–ด๊ฐ‘๋‹ˆ๋‹ค.

 

./build

WiringPi๋ฅผ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.           

gpio -v 

gpio์„ค์น˜๊ฐ€ ์ž˜ ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ด๋ด…๋‹ˆ๋‹ค.

gpio readall 

 

gpoiํ•€์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ์ฝ”๋“œ์ž‘์„ฑ์‹œ์˜ wiringPi์˜ ํ•€๋ฒˆํ˜ธ์™€, ์‹ค์ œ (BCM) ํ•€๋ฒˆํ˜ธ๊ฐ€ ๋‹ค๋ฆ…๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ๋ญ”๊ฐ€ ์ƒˆ๋กœ์ด ํ• ๋•Œ ์—ฌ๋Ÿฌ๋ฒˆ ๋ณด๊ฒŒ ๋ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

 

Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.