Skip to content

Commit

Permalink
Test file derived from #4
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Oct 31, 2016
1 parent 6f31dc4 commit 0e10a96
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/perl

# Borrowed from https://github.com/WiringPi/WiringPi-Perl/issues/4 - thank you ;)

use wiringpi;
use constant {
OUTPUT=>1,
INPUT=>0,
HIGH=>1,
LOW=>0
};

if( wiringpi::wiringPiSetup()==-1 ){
die 1;
}

wiringpi::pinMode(8,INPUT);

print("Reading pin BCM 2 (SDA) which has a hardware pull-up\n");
print("result should be 1: ".wiringpi::digitalRead(8)."\n");

0 comments on commit 0e10a96

Please sign in to comment.