Acme::FishFarm - A Fish Farm with Automated Systems
Version 1.01
use 5.010;
use Acme::FishFarm ":all";
my $water_monitor = Acme::FishFarm::WaterConditionMonitor->install;
my $oxygen = Acme::FishFarm::OxygenMaintainer->install( DO_generation_volume => 1.92 );
$water_monitor->add_oxygen_maintainer( $oxygen );
say "Water condition monitor installed...";
say "Oxygen maintainer installed and connected to water condition monitor...";
say "Water condition monitor switched on!";
say "";
while ( "fish are swimming happily" ) {
### DO
check_DO( $oxygen, reduce_precision( rand(8) ) );
say "";
### pH
check_pH( $water_monitor, 6.912 );
#check_pH( $water_monitor, 5.9 );
say "" ;
## temperature
#check_temperature( $water_monitor, 23 );
check_temperature( $water_monitor, 26 );
say "";
## turbidity
check_turbidity( $water_monitor, 120 );
#check_turbidity( $water_monitor, 190 );
say "";
# all LEDs
render_leds( $water_monitor );
say "";
# buzzers
render_buzzer( $water_monitor );
sleep(3);
say "-----------------------------";
}
The :all
tag can be used to import all the subroutines available in this module.
Almost all the subroutines in this module will give output. The unit measurements used will be according to the ones mentioned in Acme::FishFarm::WaterConditionMonitor
.
Installs all the available systems the default way and returns them as a list of Acme::FishFarm::*
objects in the following sequence:
(Feeder, OxygenMaintainer, WaterConditionMonitor, WaterLevelMaintainer, WaterFiltration)
Reduces positive or negative $decimal
to a 3-decimal value. Make sure to pass in a decimal with more than 3 decimal points.
Returns the reduced precision value.
This subroutine is useful if you are trying to set the current sensor readings randomly using the built-in rand
function as you do not want to end up with too many decimals on the screen.
All of the subroutines here will give output.
Take note that there are some systems that can't be connected to the water monitoring system and therefore will not effect the LEDs or buzzers. These systems are:
Acme::FishFarm::Feeder
Acme::FishFarm::WaterFiltration
Acme::FishFarm::WaterLevelMaintainer
This will cause the oxygen level (DO level) of the Acme::FishFarm::OxygenMaintainer
to reduce by $consumed_oxygen mg/L
Returns 1 upon success.
This checks and outputs the condition of the current DO level.
Take note that this process will trigger the LED and buzzer if abnormal condition is present.
Returns 1 upon success.
This checks and outputs the condition of the current pH value.
Take note that this process will trigger the LED and buzzer if abnormal condition is present.
Returns 1 upon success.
This checks and outputs the condition of the current temperature.
Take note that this process will trigger the LED and buzzer if abnormal condition is present.
Returns 1 upon success.
This checks and outputs the condition of the current temperature.
Take note that this process will trigger the LED and buzzer if abnormal condition is present.
Returns 1 upon success.
This checks, performs necessary actions and outputs the condition of the current waste count in the filtering cylinder.
Take note that this process DOES NOT trigger the LED and buzzer if abnormal condition is present.
Returns 1 upon success.
This checks, performs necessary actions and outputs the condition of the current waste count in the filtering cylinder.
Take note that this process DOES NOT trigger the LED and buzzer if abnormal condition is present.
Returns 1 upon success.
This checks, performs necessary actions and outputs the condition of the feeder. Each call will tick the clock inside the feeder. See Acme::FishFarm::Feeder
for more info.
If the food tank is empty, it will be filled to the default. So if you want to fill a different amount, please set the amount before hand. See Acme::FishFarm::Feeder
.
Setting $verbose
to 1 will give more output about the empty food tank.
Take note that this process DOES NOT trigger the LED and buzzer if abnormal condition is present.
Returns 1 upon success.
Outputs which LEDs are lighted up. Returns 1 upon success.
Currently this subroutine only shows the LEDs present in the Acme::FishFarm::WaterConditionMonitor
object. See that module for more details about the available LEDs.
More LEDs will be available in the future.
Outputs which buzzer is buzzing. Returns 1 upon success.
See Acme::FishFarm::WaterConditionMonitor
for details on how the short and long buzzers are switched on and off.
Raphael Jong Jun Jie, <ellednera at cpan.org>
Please report any bugs or feature requests to bug-acme-fishfarm at rt.cpan.org
, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Acme-FishFarm. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Acme::FishFarm
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
CPAN Ratings
Search CPAN
Besiyata d'shmaya
Acme::FishFarm::Feeder
Acme::FishFarm::OxygenMaintainer
Acme::FishFarm::WaterConditionMonitor
Acme::FishFarm::WaterFiltration
Acme::FishFarm::::WaterLevelMaintainer
This software is Copyright (c) 2021 by Raphael Jong Jun Jie.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)