RPi-WiringPi
view release on metacpan or search on metacpan
Returns a RPi::LCD object, which allows you to fully manipulate LCD
displays connected to your Raspberry Pi.
Please see the linked documentation for information regarding the
parameters required.
pin($pin_num)
Returns a RPi::Pin object, mapped to a specified GPIO pin, which you
can then perform operations on. See that documentation for full usage
details.
Parameters:
$pin_num
Mandatory, Integer: The pin number to attach to.
rtc
Creates a new RPi::RTC::DS3231 object which provides access to the
DS3231 or DS1307 real-time clock modules.
See the linked documentation for full documentation on usage, or the
RPi::WiringPi::FAQ for some usage examples.
Parameters:
$i2c_addr
Optional, Integer: The I2C address of the RTC module. Defaults to 0x68
for the DS3231 unit.
expander
Creates a new RPi::GPIOExpander::MCP23017 GPIO expander chip object.
This adds an additional 16 pins across two banks (8 pins per bank).
See the linked documentation for full documentation on usage, or the
RPi::WiringPi::FAQ for some usage examples.
Parameters:
$i2c_addr
Optional, Integer: The I2C address of the device. Defaults to 0x20.
$expander
Optional, String: The GPIO expander device type. Defaults to MCP23017,
and currently, this is the only option available.
serial($device, $baud)
Creates a new RPi::Serial object which allows basic read/write access
to a serial bus.
See the linked documentation for full documentation on usage, or the
RPi::WiringPi::FAQ for usage examples.
NOTE: Bluetooth on the Pi overlays the serial pins (14, 15) on the Pi.
To use serial, you must disable bluetooth in the /boot/config.txt file:
dtoverlay=pi3-disable-bt-overlay
servo($pin_num)
This method configures PWM clock and divisor to operate a typical 50Hz
servo, and returns a special RPi::Pin object. These servos have a left
pulse of 50, a centre pulse of 150 and a right pulse of 250. On exit of
the program (or a crash), we automatically clean everything up
properly.
Parameters:
$pin_num
Mandatory, Integer: The pin number (technically, this *must* be 18 on
the Raspberry Pi 3, as that's the only hardware PWM pin.
%pwm_config
Optional, Hash. This parameter should only be used if you know what
you're doing and are having very specific issues.
Keys are clock with a value that coincides with the PWM clock speed. It
defaults to 192. The other key is range, the value being an integer
that sets the range of the PWM. Defaults to 2000.
Example:
my $servo = $pi->servo(18);
$servo->pwm(50); # all the way left
$servo->pwm(250); # all the way right
shift_register($base, $num_pins, $data, $clk, $latch)
Allows you to access the output pins of up to four 74HC595 shift
registers in series, for a total of eight new output pins per register.
Numerous chains of four registers are permitted, each chain uses three
GPIO pins.
Parameters:
$base
Mandatory: Integer, represents the number at which you want to start
referencing the new output pins attached to the register(s). For
example, if you use 100 here, output pin 0 of the register will be 100,
output 1 will be 101 etc.
$num_pins
Mandatory: Integer, the number of output pins on the registers you want
to use. Each register has eight outputs, so if you have a single
register in use, the maximum number of additional pins would be eight.
$data
Mandatory: Integer, the GPIO pin number attached to the DS pin (14) on
the shift register.
$clk
( run in 1.685 second using v1.01-cache-2.11-cpan-5837b0d9d2c )