Acme-FishFarm
view release on metacpan or search on metacpan
docs/Acme-FishFarm-WaterConditionMonitor-1.01.html view on Meta::CPAN
use Acme::FishFarm::WaterConditionMonitor;
use Acme::FishFarm::OxygenMaintainer;
my $water_monitor = Acme::FishFarm::WaterConditionMonitor->install;
my $oxygen = Acme::FishFarm::OxygenMaintainer->install( DO_generation_volume => 1.92 );
$water_monitor->add_oxygen_maintainer( $oxygen );
# always check water conditions before checking LEDs and buzzers
# also, these four method will return 1 or 0, upon calling them, the status of LEDs and buzzers will also be updated
$water_monitor->ph_is_normal;
$water_monitor->temperature_is_normal;
$water_monitor->lacking_oxygen;
$water_monitor->water_dirty;
if ( $water_monitor->is_on_LED_DO ) {
# do something, same goes to the rest of the LEDs
}
if ( $water_monitor->is_on_buzzer_short ) {
lib/Acme/FishFarm/WaterConditionMonitor.pm view on Meta::CPAN
use Acme::FishFarm::WaterConditionMonitor;
use Acme::FishFarm::OxygenMaintainer;
my $water_monitor = Acme::FishFarm::WaterConditionMonitor->install;
my $oxygen = Acme::FishFarm::OxygenMaintainer->install( DO_generation_volume => 1.92 );
$water_monitor->add_oxygen_maintainer( $oxygen );
# always check water conditions before checking LEDs and buzzers
# also, these four method will return 1 or 0, upon calling them, the status of LEDs and buzzers will also be updated
$water_monitor->ph_is_normal;
$water_monitor->temperature_is_normal;
$water_monitor->lacking_oxygen;
$water_monitor->water_dirty;
if ( $water_monitor->is_on_LED_DO ) {
# do something, same goes to the rest of the LEDs
}
if ( $water_monitor->is_on_buzzer_short ) {
( run in 0.225 second using v1.01-cache-2.11-cpan-05444aca049 )