File Coverage

blib/lib/Device/L3GD20.pm
Criterion Covered Total %
statement 18 21 85.7
branch n/a
condition n/a
subroutine 6 7 85.7
pod n/a
total 24 28 85.7


line stmt bran cond sub pod time code
1 1     1   12276 use strict;
  1         1  
  1         25  
2 1     1   3 use warnings;
  1         1  
  1         32  
3              
4             package Device::L3GD20;
5              
6             # PODNAME: Device::L3GD20
7             # ABSTRACT: I2C interface to L3GD20 3 axis GyroScope using Device::SMBus
8             #
9             # This file is part of Device-L3GD20
10             #
11             # This software is copyright (c) 2015 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             our $VERSION = '0.009'; # VERSION
17              
18             # Dependencies
19 1     1   11 use 5.010;
  1         1  
  1         25  
20 1     1   389 use Moose;
  1         311411  
  1         7  
21 1     1   5325 use POSIX;
  1         4111  
  1         3  
22              
23 1     1   2018 use Device::Gyroscope::L3GD20;
  1         2  
  1         100  
24              
25              
26             has 'I2CBusDevicePath' => ( is => 'ro', );
27              
28              
29             has Gyroscope => (
30             is => 'ro',
31             isa => 'Device::Gyroscope::L3GD20',
32             lazy_build => 1,
33             );
34              
35             sub _build_Gyroscope {
36 0     0     my ($self) = @_;
37 0           my $obj =
38             Device::Gyroscope::L3GD20->new(
39             I2CBusDevicePath => $self->I2CBusDevicePath, );
40 0           return $obj;
41             }
42              
43             1;
44              
45             __END__
46              
47             =pod
48              
49             =head1 NAME
50              
51             Device::L3GD20 - I2C interface to L3GD20 3 axis GyroScope using Device::SMBus
52              
53             =head1 VERSION
54              
55             version 0.009
56              
57             =head1 ATTRIBUTES
58              
59             =head2 I2CBusDevicePath
60              
61             this is the device file path for your I2CBus that the L3GD20 is connected on e.g. /dev/i2c-1
62             This must be provided during object creation.
63              
64             =head2 Gyroscope
65              
66             $self->Gyroscope->enable();
67             $self->Gyroscope->getReading();
68              
69             This is a object of L<Device::Gyroscope::L3GD20>
70              
71             =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan
72              
73             =head1 SUPPORT
74              
75             =head2 Bugs / Feature Requests
76              
77             Please report any bugs or feature requests through github at
78             L<https://github.com/shantanubhadoria/perl-device-l3gd20/issues>.
79             You will be notified automatically of any progress on your issue.
80              
81             =head2 Source Code
82              
83             This is open source software. The code repository is available for
84             public review and contribution under the terms of the license.
85              
86             L<https://github.com/shantanubhadoria/perl-device-l3gd20>
87              
88             git clone git://github.com/shantanubhadoria/perl-device-l3gd20.git
89              
90             =head1 AUTHOR
91              
92             Shantanu Bhadoria <shantanu at cpan dott org>
93              
94             =head1 CONTRIBUTORS
95              
96             =for stopwords Shantanu Bhadoria
97              
98             =over 4
99              
100             =item *
101              
102             Shantanu <shantanu@cpan.org>
103              
104             =item *
105              
106             Shantanu Bhadoria <shantanu@cpan.org>
107              
108             =back
109              
110             =head1 COPYRIGHT AND LICENSE
111              
112             This software is copyright (c) 2015 by Shantanu Bhadoria.
113              
114             This is free software; you can redistribute it and/or modify it under
115             the same terms as the Perl 5 programming language system itself.
116              
117             =cut