embeded/raspberry pi2015. 6. 10. 10:21

엥? 머가 많이 다른 구조인데?!?!

pi@raspberrypi /sys/class/gpio $ tree

.

├── export

├── gpiochip0 -> ../../devices/soc/3f200000.gpio/gpio/gpiochip0

└── unexport


1 directory, 2 files 


unexport 해봤지만.. PWM으로 GPIO1을 바꿔봐도 원복되진 않네...

To remove the configuration of the pin, use:

$ gpio unexport 1

To remove all configurations:

$ gpio unexportall

Feel free to use the gpio program to configure other pins as input or output (PWM is only for special function pins like GPIO18(WiringPi 1), other PWM pins are occupied by the 3.5mm audio connector.


[링크 : https://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpio] 


Posted by 구차니
embeded/raspberry pi2015. 6. 9. 21:19

음.. 정 안되던거 다시 시도!


일단은 config.txt에서

간단하게 주석만 삭제하고 lirc 설정

# Uncomment this to enable the lirc-rpi module

dtoverlay=lirc-rpi 


pi@raspberrypi /boot $ dmesg | grep -i lirc

[    4.369486] lirc_dev: IR Remote Control driver registered, major 246

[    4.416487] lirc_rpi: module is from the staging directory, the quality is unknown, you have been warned.

[    5.397784] lirc_rpi: auto-detected active high receiver on GPIO pin 18

[    5.410733] lirc_rpi lirc_rpi: lirc_dev: driver lirc_rpi registered at minor = 0

[    5.424117] lirc_rpi: driver registered! 


gpio 상으로는 input으로 그냥.. 일반 gpio로 잡히는데..

pi@raspberrypi ~ $ gpio readall

 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+

 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |

 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+

 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |

 |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5V      |     |     |

 |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |

 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | ALT0 | TxD     | 15  | 14  |

 |     |     |      0v |      |   |  9 || 10 | 1 | ALT0 | RxD     | 16  | 15  |

 |  17 |   0 | GPIO. 0 |  OUT | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |

 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |

 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |

 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |

 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |

 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |

 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |

 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |

 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |

 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |

 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |

 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |

 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |

 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |

 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |

 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+

 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |

 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+ 


여전히 리모컨 못 읽는건 여전..

센서를 태워먹었나... ㅠㅠ


[링크 : http://ozzmaker.com/2013/10/24/how-to-control-the-gpio-on-a-raspberry-pi-with-an-ir-remote/]

Posted by 구차니
embeded/raspberry pi2015. 6. 9. 20:52

wiring pi로 테스트

리본케이블은 어떻게 연결되는지 모르겠는데..

아무튼 연결해보니 좌우가 바뀌었다!!! 두둥!!!

(하드는 그럼 어떻게 연결된거였던거야? ㄷㄷㄷ)


귀차니즘으로.. 220옴 연결안하고

GPIO와 GND 연결해주니 문제없이 불 들어 오고 열은 미미하게 나는 수준

물론.. 5V와 GNGD에 연결하면 손을 델 정도로 심하게 열이 나니

LED 손상될 것 같아서 후다닥 뺴고 던지기 신공 -_ㅠ


LED는 7(+) 9(-) 연결

pi@raspberrypi ~/src/java $ sudo gpio write 7 1

pi@raspberrypi ~/src/java $ gpio readall

 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+

 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |

 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+

 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |

 |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5V      |     |     |

 |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |

 |   4 |   7 | GPIO. 7 |  OUT | 1 |  7 || 8  | 1 | ALT0 | TxD     | 15  | 14  |

 |     |     |      0v |      |   |  9 || 10 | 1 | ALT0 | RxD     | 16  | 15  |

 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |

 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |

 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |

 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |

 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |

 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |

 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |

 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |

 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |

 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |

 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |

 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |

 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |

 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |

 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |

 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+

 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |

 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+ 




pi@raspberrypi ~/src/java $ sudo gpio write 7 0

pi@raspberrypi ~/src/java $ gpio readall
 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5V      |     |     |
 |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |  OUT | 0 |  7 || 8  | 1 | ALT0 | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | ALT0 | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |

 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+ 






2015/06/08 - [개소리 왈왈/라즈베리 파이 2] - 라즈베리 파이 2 wiringpi 설치 / pi4j



pi@raspberrypi ~/src/java $ gpio mode 1 pwm

pi@raspberrypi ~/src/java $ gpio readall

 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+

 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |

 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+

 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |

 |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5V      |     |     |

 |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |

 |   4 |   7 | GPIO. 7 |  OUT | 0 |  7 || 8  | 1 | ALT0 | TxD     | 15  | 14  |

 |     |     |      0v |      |   |  9 || 10 | 1 | ALT0 | RxD     | 16  | 15  |

 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 1 | ALT5 | GPIO. 1 | 1   | 18  |

 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |

 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |

 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |

 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |

 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |

 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |

 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |

 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |

 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |

 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |

 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |

 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |

 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |

 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |

 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+

 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |

 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+


pi@raspberrypi ~/src/java $ gpio pwm 1 128

pi@raspberrypi ~/src/java $ gpio pwm 1 512

pi@raspberrypi ~/src/java $ gpio pwm 1 1024 



PWM - 128 / 1024


PWM - 512 / 1024


PWM - 1024 / 1024


핀위치는 12(+) 14(-)번 핀 연결



[링크 : http://wiringpi.com/the-gpio-utility/]

Posted by 구차니
embeded/raspberry pi2015. 6. 8. 20:31

패키지로 다운로드 될줄 알았는데 안되네..


일단 사용한 녀석은


라즈베리 2

2015-05-05-raspbian-wheezy.img


wiringpi

pi@raspberrypi ~ $ sudo apt-get install git-core

pi@raspberrypi ~ $ mkdir src

pi@raspberrypi ~ $ cd src

pi@raspberrypi ~/src $ 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 536), reused 96 (delta 58)

Receiving objects: 100% (742/742), 264.80 KiB | 128 KiB/s, done.

Resolving deltas: 100% (536/536), done.

pi@raspberrypi ~/src $ cd wiringPi/

pi@raspberrypi ~/src/wiringPi $ git pull origin

Already up-to-date.

pi@raspberrypi ~/src/wiringPi $ ./build

wiringPi Build script

=====================



WiringPi Library

[UnInstall]

[Compile] wiringPi.c

[Compile] wiringSerial.c

[Compile] wiringShift.c

[Compile] piHiPri.c

[Compile] piThread.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] piNes.c

[Compile] maxdetect.c

[Compile] gertboard.c

[Compile] piFace.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@raspberrypi ~/src/wiringPi $ gpio readall

 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+

 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |

 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+

 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |

 |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5V      |     |     |

 |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |

 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | ALT0 | TxD     | 15  | 14  |

 |     |     |      0v |      |   |  9 || 10 | 1 | ALT0 | RxD     | 16  | 15  |

 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |

 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |

 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |

 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |

 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |

 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |

 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |

 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |

 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |

 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |

 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |

 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |

 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |

 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |

 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |

 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+

 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |

 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+ 


[링크 : http://wiringpi.com/download-and-install/]



pi4j

pi@raspberrypi ~/src/java $ wget http://get.pi4j.com/download/pi4j-1.0.deb

--2015-06-08 11:35:02--  http://get.pi4j.com/download/pi4j-1.0.deb

Resolving get.pi4j.com (get.pi4j.com)... 54.231.18.148

Connecting to get.pi4j.com (get.pi4j.com)|54.231.18.148|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 616120 (602K) [application/octet-stream]

Saving to: `pi4j-1.0.deb'


100%[======================================>] 616,120      255K/s   in 2.4s


2015-06-08 11:35:05 (255 KB/s) - `pi4j-1.0.deb' saved [616120/616120]


pi@raspberrypi ~/src/java $ sudo dpkg -i pi4j-1.0.deb

Selecting previously unselected package pi4j.

(데이터베이스 읽는중 ...현재 77870개의 파일과 디렉터리가 설치되어 있습니다.)

pi4j 패키지를 푸는 중입니다 (pi4j-1.0.deb에서) ...

pi4j (1.0) 설정하는 중입니다 ...


pi@raspberrypi ~/src/java $ sudo apt-get install pi4j

패키지 목록을 읽는 중입니다... 완료

의존성 트리를 만드는 중입니다

상태 정보를 읽는 중입니다... 완료

pi4j 패키지는 이미 최신 버전입니다.

0개 업그레이드, 0개 새로 설치, 0개 제거 및 3개 업그레이드 안 함.



pi@raspberrypi ~/src/java $ ls -al /opt/pi4j/lib

합계 496

drwxr-xr-x 2 root root   4096  6월  8 11:35 .

drwxr-xr-x 5 root root   4096  6월  8 11:35 ..

-rw-r--r-- 1 root root 179187  4월 18 16:02 pi4j-core.jar

-rw-r--r-- 1 root root 217311  4월 18 16:02 pi4j-device.jar

-rw-r--r-- 1 root root  74078  4월 18 16:02 pi4j-gpio-extension.jar

-rw-r--r-- 1 root root  17663  4월 18 16:02 pi4j-service.jar


pi@raspberrypi ~/src/java $ vi TriggerGpio.java


import java.util.concurrent.Callable;


import com.pi4j.io.gpio.GpioController;

import com.pi4j.io.gpio.GpioFactory;

import com.pi4j.io.gpio.GpioPinDigitalInput;

import com.pi4j.io.gpio.GpioPinDigitalOutput;

import com.pi4j.io.gpio.PinPullResistance;

import com.pi4j.io.gpio.PinState;

import com.pi4j.io.gpio.RaspiPin;

import com.pi4j.io.gpio.trigger.GpioCallbackTrigger;

import com.pi4j.io.gpio.trigger.GpioPulseStateTrigger;

import com.pi4j.io.gpio.trigger.GpioSetStateTrigger;

import com.pi4j.io.gpio.trigger.GpioSyncStateTrigger;


public class TriggerGpio {


    public static void main(String[] args) throws InterruptedException {


        System.out.println("START");


        // create gpio controller

        final GpioController gpio = GpioFactory.getInstance();


        // provision gpio pin #02 as an input pin with its internal pull down resistor enabled

        final GpioPinDigitalOutput ledPin = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_07, PinState.LOW);


        ledPin.setState(PinState.HIGH);


    }

}


pi@raspberrypi ~/src/java $ date;javac -classpath .:classes:/opt/pi4j/lib/'*' TriggerGpio.java ;date

2015. 06. 08. (월) 11:40:03 UTC

2015. 06. 08. (월) 11:40:09 UTC 


pi@raspberrypi ~/src/java $ sudo java -classpath .:classes:/opt/pi4j/lib/'*' TriggerGpio

START


[링크 : http://pi4j.com/download.html]

Posted by 구차니
embeded/raspberry pi2015. 6. 4. 23:29

일단.. B+와 호환되는 녀석으로 알고 있으니..

음.. PCM_CLK는 말그대로 클럭이니.. PCM_DIN에 연결이 되어야 하는거 아닐려나?


아니면...

그냥 GPIO로 CPU 쪽쪽 빨아가면서 구현하는 걸려나?






[링크 : http://elinux.org/RPi_BCM2835_GPIOs]

Posted by 구차니
embeded/raspberry pi2015. 6. 4. 22:57

2012년 글에서는 I2S가 사라졌다고 하는데

리비전 2 부터는 P5 헤더에 존재하게 되엇다는데 끄응..

라즈베리 2에서 안되는거 같기도 하고... 미지수네


Moderator: this is an old thread! Since revision 2 the PI has a new header P5 which has I2S.

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?f=7&t=2631]



  • P1: 26-pin (2x13) 2.54 mm header expansion, providing: see Low-level peripherals
    • GPIOs at 3v3
    • 2-pin UART serial console, 3v3 TTL (debug); or 2 GPIOs at 3v3
    • I²C interface (3v3); or 2 GPIOs at 3v3
    • SPI interface (3v3); or 5 GPIOs at 3v3
    • 3v3, 5v and GND supply pins
    • ARM JTAG (if pins are reconfigured in software - on Revision1.0 boards one signal would also need to be taken from S5)
    • I²S interface (if pins are reconfigured in software, hardware hack may be required[4])
  • P2: 8-pin 2.54 mm header expansion (header not fitted on Revision 2.0 boards), providing GPU JTAG (ARM11 pinout, pin 7 is nofit for locating)
  • P3: 7-pin 2.54 mm header expansion (header not fitted), providing LAN9512 JTAG (pin 6 is nofit for locating)
  • P4: 10/100Mb RJ45 Ethernet jack (Model B)
  • P5: 8-pin (2x4) 2.54 mm header expansion (header not fitted), on the bottom of the board, providing: see Low-level peripherals (Model B Revision 2.0 and Model A boards only)
    • GPIOs at 3v3
    • 3v3, 5v and GND supply pins
    • Second I²C interface (3v3) (if pins are reconfigured in software)
    • I²S interface (if pins are reconfigured in software)
    • Handshake signals for the UART on the P1 header (if pins are reconfigured in software)
  • P6: 2-pin 2.54 mm header expansion (header not fitted), providing an option to connect a hardware-reset button (Revision 2.0 boards only)

[링크 : http://elinux.org/RPi_Hardware#cite_note-i2s-4]


I2S 2015년 글. 라즈베리 2 일려나?

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=8496]

Posted by 구차니
embeded/raspberry pi2015. 5. 31. 20:07

2015년 05월 31일 (일) 오후 07시 55분 25초 

2015. 05. 31. (일) 20:05:59 KST


음.. 10분...




2015/03/23 - [개소리 왈왈/라즈베리 파이 2] - 라즈베리 파이 2 커널 빌드


'embeded > raspberry pi' 카테고리의 다른 글

라즈베리 파이 2 pinput?  (0) 2015.06.04
라즈베리 파이 I2S / PCM...?  (0) 2015.06.04
class 6 SDHC 굽는 속도  (0) 2015.05.24
어허허 파워드 허브를 사야하나? -_-  (0) 2015.05.23
openelec 5.0.8 lirc 활성화 확인  (0) 2015.05.12
Posted by 구차니
embeded/raspberry pi2015. 5. 24. 01:27

별별 쓸데없는 글이겠지만...




class10이 15MB 근접하게 나오는데 반해

class6은 10MB 근접하게 나오는 수준..


라즈베리 파이에서는 SDXC UHS를 지원안하니 SDHC class 10이 그나마.. 최선의 방법이려나?

Posted by 구차니
embeded/raspberry pi2015. 5. 23. 19:21

USB 카메라 달아서 vlc 통해서 비디오 보려니

첫 프레임 오고 나서 뻗어버림 -_-


아마도.. 100mA 제한이 걸린거라 그런걸지도 모르겠지만...

흐음.. 보드를 수정하는 식으로 어떻게 리미트를 해제할 방법이 없으려나?

어짜피 파워는 외부에서 2A로 공급을 받는녀석인데...



허허허 찾아보니..

elinux 왈...

powered hub에서 하나는 파워로 해서 라즈베리 연결하고

허브에 라즈베리 USB를 연결해라.. -_-



[링크 : http://elinux.org/RPi_Powered_USB_Hubs]


The HDMI port uses 50mA, the camera module requires 250mA, and keyboards and mice can take as little as 100mA

[링크 : https://www.raspberrypi.org/documentation/hardware/raspberrypi/power/README.md]

[링크 : https://www.raspberrypi.org/help/faqs/#powerReqs]

'embeded > raspberry pi' 카테고리의 다른 글

라즈베리파이 2 커널 AMD 945 에서 빌드  (0) 2015.05.31
class 6 SDHC 굽는 속도  (0) 2015.05.24
openelec 5.0.8 lirc 활성화 확인  (0) 2015.05.12
openELEC 5.0.8  (0) 2015.05.12
wiring Pi  (0) 2015.05.12
Posted by 구차니
embeded/raspberry pi2015. 5. 12. 20:44

config.txt

dtoverlay=lirc-rpi,gpio_in_pin=18,debug=on


으로 설정하니 예전 5.0.4랑 차이가 없는 것으로 보인다.

gpio-18은 언제 쯤 나오려나.. ㅠㅠ


OpenELEC:~ # modprobe lirc_rpi debug=1


OpenELEC:~ # cat /sys/kernel/debug/gpio


GPIOs 0-53, platform/3f200000.gpio, pinctrl-bcm2835:

 gpio-35  (led1                ) in  hi

 gpio-47  (led0                ) out lo


OpenELEC:~ # cat /proc/interrupts

            CPU0       CPU1       CPU2       CPU3

 16:          0          0          0          0   ARMCTRL  16  bcm2708_fb dma

 24:         35          0          0          0   ARMCTRL  24  DMA IRQ

 25:       1414          0          0          0   ARMCTRL  25  DMA IRQ

 32:      28402          0          0          0   ARMCTRL  32  dwc_otg, dwc_otg_pcd, dwc_otg_hcd:usb1

 49:          0          0          0          0   ARMCTRL  49  3f200000.gpio:bank0

 50:          0          0          0          0   ARMCTRL  50  3f200000.gpio:bank1

 65:         28          0          0          0   ARMCTRL  65  ARM Mailbox IRQ

 66:      37570          0          0          0   ARMCTRL  66  VCHIQ doorbell

 75:          1          0          0          0   ARMCTRL  75

 84:       5247          0          0          0   ARMCTRL  84  mmc0

 99:       7986       6287       9505       6913   ARMCTRL  99  arch_timer

466:          0          0          0          0  pinctrl-bcm2835  18  lirc_rpi

FIQ:              usb_fiq

IPI0:          0          0          0          0  CPU wakeup interrupts

IPI1:          0          0          0          0  Timer broadcast interrupts

IPI2:       9274      26365      21700      11433  Rescheduling interrupts

IPI3:          1          3          5          5  Function call interrupts

IPI4:          3          1          0          1  Single function call interrupts

IPI5:          0          0          0          0  CPU stop interrupts

IPI6:          1          0          0          0  IRQ work interrupts

IPI7:          0          0          0          0  completion interrupts

Err:          0


OpenELEC:~ # dmesg | grep -i lirc

[    5.758491] lirc_dev: IR Remote Control driver registered, major 248

[    5.784692] lirc_rpi: module is from the staging directory, the quality is unknown, you have been warned.

[    5.786415] lirc_rpi: to_irq 466

[    6.679084] lirc_rpi: auto-detected active high receiver on GPIO pin 18

[    6.679548] lirc_rpi lirc_rpi: lirc_dev: driver lirc_rpi registered at minor = 0

[    6.679576] lirc_rpi: driver registered!

[    6.917559] input: lircd as /devices/virtual/input/input1

[    7.945875] lirc_rpi: Interrupt 466 obtained

[    7.945897] lirc_rpi: in init_timing_params, freq=38000 pulse=13157, space=13158


OpenELEC:~ # lsmod | grep irc

lirc_rpi                5882  3

lirc_dev                7578  1 lirc_rpi

rc_core                14603  1 lirc_dev 



'embeded > raspberry pi' 카테고리의 다른 글

class 6 SDHC 굽는 속도  (0) 2015.05.24
어허허 파워드 허브를 사야하나? -_-  (0) 2015.05.23
openELEC 5.0.8  (0) 2015.05.12
wiring Pi  (0) 2015.05.12
UHS 지원여부?  (0) 2015.05.11
Posted by 구차니