| 1 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | package Device::PCA9685; | ||
| 5 | |||
| 6 | # PODNAME: Device::PCA9685 | ||
| 7 | # ABSTRACT: I2C interface to PCA9685 16 channel 12 bit PWM Generator | ||
| 8 | # | ||
| 9 | # This file is part of Device-PCA9685 | ||
| 10 | # | ||
| 11 | # This software is copyright (c) 2016 by Shantanu Bhadoria. | ||
| 12 | # | ||
| 13 | # This is free software; you can redistribute it and/or modify it under | ||
| 14 | # the same terms as the Perl 5 programming language system itself. | ||
| 15 | # | ||
| 16 | 1 | our $VERSION = '0.004'; # VERSION | |
| 17 | |||
| 18 | # Dependencies | ||
| 19 | 1 | ▶ | use 5.010; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | 1 | ▶ | use POSIX; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | |||
| 23 | 1 | ▶ | use Device::PWMGenerator::PCA9685; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 24 | |||
| 25 | |||
| 26 | 1 | has 'I2CBusDevicePath' => ( is => 'ro', ); | |
| 27 | |||
| 28 | |||
| 29 | 1 | has PWMGenerator => ( | |
| 30 | is => 'ro', | ||
| 31 | isa => 'Device::PWMGenerator::PCA9685', | ||
| 32 | lazy_build => 1, | ||
| 33 | ); | ||
| 34 | |||
| 35 | 0 | ▶ | sub _build_PWMGenerator { |
|
Subroutine
_build_PWMGenerator: not called CC=1 SCAR=6.9
| |||
| 36 | 0 | my ($self) = @_; | |
| 37 | 0 | my $obj = Device::PWMGenerator::PCA9685->new( | |
| 38 | I2CBusDevicePath => $self->I2CBusDevicePath, | ||
| 39 | frequency => 400, | ||
| 40 | debug => 0, | ||
| 41 | ); | ||
| 42 | 0 | return $obj; | |
| 43 | } | ||
| 44 | |||
| 45 | 1 | 1; | |
| 46 | |||
| 47 | __END__ | ||