4
3

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 で WiringPi

Last updated at Posted at 2016-04-28

Wiring Pi
GPIO Interface library for the Raspberry Pi
http://wiringpi.com/
RaspberryPi のI/O関数セット

Download and Install

$ git clone git://git.drogon.net/wiringPi
$ cd wiringPi
$ git pull origin
$ ./build

コンパイル&実行

$ cc -o 実行ファイル名 ソースファイル名 -lwiringPi
$ sudo ./実行ファイル名
$

サンプル・プログラム

リビジョン取得

ソースプログラム

revision.c
#include <stdio.h>
#include <wiringPi.h>

int main(int argc, char *argv[])
{
        printf("Revision = %d\n", piBoardRev());
        return 0;
}

コンパイル&実行

$ cc -o revision revision.c -lwiringPi
$ sudo ./revision
Revision = 2
$

参考
トランジスタ技術2016年3月号別冊付録
「全ラズパイ対応!楽々I/O関数セット
 WiringPi虎の巻」
http://toragi.cqpub.co.jp/tabid/781/Default.aspx

4
3
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
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?