#! /usr/bin/perl # hipiblink.pl - Blink the LED on pin 10 to figure out how to use HiPi # James M. Lynes, Jr. - KE4MIQ # Created: June 10, 2020 # Last Modified: 06/10/2020 - Initial version based on the HiPi Perl Module # by Mark Dootson # # Notes: Replaces RPi::WiringPi by Steve Bertrand, WiringPi has been deprecated # HiPi is a Perl library for the Raspberry Pi SBCs that # allow access to the RPi GPIO pins from Perl # The pin object wrapper is similar to the RPi::WiringPi syntax use strict; use warnings; use HiPi qw( :rpi ); use HiPi::GPIO; my $gpio = HiPi::GPIO->new; # Create a GPIO object my $pin = $gpio->get_pin(10); # Create a pin object(Red LED on proto front panel) $pin->mode(RPI_MODE_OUTPUT); # Set pinmode to output while(1) { $pin->value(1); # LED on sleep(1); $pin->value(0); # LED off sleep(1); }