Skip to content

Commit 0e10a96

Browse files
committed
Test file derived from #4
1 parent 6f31dc4 commit 0e10a96

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test.pl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/perl
2+
3+
# Borrowed from https://github.com/WiringPi/WiringPi-Perl/issues/4 - thank you ;)
4+
5+
use wiringpi;
6+
use constant {
7+
OUTPUT=>1,
8+
INPUT=>0,
9+
HIGH=>1,
10+
LOW=>0
11+
};
12+
13+
if( wiringpi::wiringPiSetup()==-1 ){
14+
die 1;
15+
}
16+
17+
wiringpi::pinMode(8,INPUT);
18+
19+
print("Reading pin BCM 2 (SDA) which has a hardware pull-up\n");
20+
print("result should be 1: ".wiringpi::digitalRead(8)."\n");

0 commit comments

Comments
 (0)