¤¢¤ó¤Þ¤êÀèÎ㤬¤Ê¤¯¤Æ¶ìÏ«¤·¤¿¡£
¥¤¥ó¥¹¥È¡¼¥ë
wiringPi-Perl¤Î¾¤ËWiringPi¤½¤Î¤â¤Î¤âɬÍפ餷¤¤¡£$ git clone git://github.com/WiringPi/WiringPi-Perl.git
$ cd WiringPi-Perl/
$ git clone git://github.com/WiringPi/WiringPi.git
build.sh¤È¤¤¤¦¥¹¥¯¥ê¥×¥È¤¬¤¢¤ë¤¬¡¢¤³¤ì¤ò¤³¤Î¤Þ¤Þ¼Â¹Ô¤·¤Æ¤â¥¨¥é¡¼¤Ë¤Ê¤ë¡£$ ./build.sh
wiringpi_wrap.c:730:20: fatal error: EXTERN.h: No such file or directory
compilation terminated.
gcc: error: wiringpi_wrap.o: No such file or directory
build.sh¤ò½ñ¤´¹¤¨¤ë¡£Êѹ¹Á°
gcc -fpic -c -Dbool=char -I/usr/lib/perl/5.14.2/CORE wiringpi_wrap.c WiringPi/wiringPi/wiringPi.c -D_GNU_SOURCE
gcc -shared wiringPi.o wiringpi_wrap.o -o wiringpi.so
Êѹ¹¸å
gcc -fpic -c -Dbool=char -I/usr/lib/perl/5.10.1/CORE wiringpi_wrap.c WiringPi/wiringPi/wiringPi.c -D_GNU_SOURCE
gcc -shared wiringPi.o wiringpi_wrap.o -o wiringpi.so
wiringSerial.h ¤ò¥³¥Ô¡¼¤¹¤ë¡£$cd WiringPi/wiringPi/
$cp wiringSerial.h serial.h
¤³¤ì¤Ç¥³¥ó¥Ñ¥¤¥ë¤¬Ä̤ä¿¡£
perl¤«¤éLED¤òÅÀÅô¤·¤Æ¤ß¤ë¡£
WiringPi¤Î´Ø¿ô¤¬¤½¤Î¤Þ¤Þ»È¤¨¤ë¡£¥µ¥ó¥×¥ë
#!/usr/bin/perl
use strict;
use warnings;
use lib qw(../WiringPi-Perl/ );
use wiringpi;
use constant {
OUTPUT=>1,
INPUT=>0,
HIGH=>1,
LOW=>0
};
if( wiringpi::wiringPiSetup()==-1 ){
die 1;
}
wiringpi::pinMode(0,OUTPUT);
wiringpi::digitalWrite(0,1);
¤³¤ì¤òroot¸¢¸Â¤Ç¼Â¹Ô¤¹¤ë¤ÈLED¤¬ÅÀÅô¤¹¤ë
»²¹Í¥µ¥¤¥È
¥¹¥«¥¤¤Î¼ÒĹÆüµ:Raspberry pi¥á¥âWiringPi Perl | AppCode
WiringPi-Perl example - LinuxQuestions.org