2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【Raspberry Pi】GPIOで出力するメモ(コマンド)

Posted at

概要

GPIO21ピンから電圧を出力

コマンド

root@raspberrypi:~# echo 21 > /sys/class/gpio/export
root@raspberrypi:~# ls /sys/class/gpio/
export  gpio21  gpiochip0  unexport
root@raspberrypi:~# echo out > /sys/class/gpio/gpio21/direction
root@raspberrypi:~# echo 1 > /sys/class/gpio/gpio21/value
root@raspberrypi:~# echo 0 > /sys/class/gpio/gpio21/value

結果

テスターで計測。ちゃんと3.3V出力されてる

ファイル 2017-05-04 22 43 22.jpeg

参考

ツール・ラボ » 第24回 Raspberry PiのGPIOを制御する(コマンド編) https://tool-lab.com/make/raspberrypi-startup-24/

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?