The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Digital - Handling conversion of digital values towards physical units

VERSION

version 0.003

SYNOPSIS

Preparing Digital::Driver class:

  package DigitalX::MyDriver;

  use Digital::Driver;

  to K => sub { ( ( $_ * 4.88 ) - 25 ) / 10 };
  overload_to C => sub { $_ - 273.15 }, 'K';
  to F => sub { ( $_ * ( 9 / 5 ) ) - 459.67 }, 'K';

  1;

Using driver class:

  use Digital qw( MyDriver );

  my $digi = input( mydriver => 613 );
  my $kelvin = $digi->K;  # 296.644
  my $celsius = $digi->C; #  23.494
  my $celsius = $digi+0;  # because of overload falls back to C

DESCRIPTION

SUPPORT

IRC

  Join #hardware on irc.perl.org. Highlight Getty for fast reaction :).

Repository

  https://github.com/cindustries/perl-digital
  Pull request and additional contributors are welcome

Issue Tracker

  https://github.com/cindustries/perl-digital/issues

AUTHOR

Torsten Raudssus <torsten@raudss.us>

COPYRIGHT AND LICENSE

This software is copyright (c) 2020 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.