Acme-FishFarm

 view release on metacpan or  search on metacpan

lib/Acme/FishFarm/WaterConditionMonitor.pm  view on Meta::CPAN

Returns true if the LED of DO is lighted up.

=cut

sub on_LED_DO {
    ref( my $self = shift ) or croak "Please use this the OO way";
    $self->{DO_LED_on} = 1;
}

sub is_on_LED_DO {
    ref( my $self = shift ) or croak "Please use this the OO way";
    return $self->{DO_LED_on};
}

=head2 on_LED_turbidity

Light up the LED for turbidity sensor, indicating high level of waste etc. Fish might die :)

=head2 is_on_LED_turbidity

Returns true if the LED of DO is lighted up.

=cut

sub on_LED_turbidity {
    ref( my $self = shift ) or croak "Please use this the OO way";
    $self->{turbidity_LED_on} = 1;
}

sub is_on_LED_turbidity {
    ref( my $self = shift ) or croak "Please use this the OO way";
    return $self->{turbidity_LED_on};
}

=head2 lighted_LED_count

Returns the number of LEDs lighted up currently

=cut

sub lighted_LED_count {
    ref( my $self = shift ) or croak "Please use this the OO way";
    
    my $total_led = 0;
    $total_led++ if $self->{pH_LED_on};
    $total_led++ if $self->{temperature_LED_on};
    $total_led++ if $self->{DO_LED_on};
    $total_led++ if $self->{turbidity_LED_on};
    
    return $total_led;
}

=head1 AUTHOR

Raphael Jong Jun Jie, C<< <ellednera at cpan.org> >>

=head1 BUGS

Please report any bugs or feature requests to C<bug-. at rt.cpan.org>, or through
the web interface at L<https://rt.cpan.org/NoAuth/ReportBug.html?Queue=.>.  I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.




=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Acme::FishFarm::WaterConditionMonitor


You can also look for information at:

=over 4

=item * RT: CPAN's request tracker (report bugs here)

L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=.>

=item * CPAN Ratings

L<https://cpanratings.perl.org/d/.>

=item * Search CPAN

L<https://metacpan.org/release/.>

=back


=head1 ACKNOWLEDGEMENTS

Besiyata d'shmaya

=head1 LICENSE AND COPYRIGHT

This software is Copyright (c) 2021 by Raphael Jong Jun Jie.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)


=cut

1; # End of Acme::FishFarm::WaterConditionMonitor



( run in 0.686 second using v1.01-cache-2.11-cpan-d8267643d1d )