Device...TEMPer(3pm)
π NAME π
okay bestie, so this is the manual page for Device::USB::PCSensor::HidTEMPer β it's a Perl module, it lives in section 3pm of the User Contributed Perl Documentation, and it's literally just the device overview. That's it. That's the whole name. Device overview. short and sweet, we love that for us. π
β¨ VERSION β¨
Version 0.04 π
πΈ SYNOPSIS πΈ
ok so first, the shared code β every setup needs this part:
use Device::USB::PCSensor::HidTEMPer;
my $pcsensor = Device::USB::PCSensor::HidTEMPer->new();
Then, if you've got a single-device situation (one thermometer, main character energy):
my $device = $pcsensor->device();
print $device->external()->fahrenheit() if defined $device->external();
And if you're running a multi-device household (a whole squad of thermometers, iconic):
my @devices = $pcsensor->list_devices();
foreach my $device ( @devices ){
print $device->internal()->celsius() if defined $device->internal();
}
notice the if defined checks bestie β they're there for a reason, don't skip them π
π¦ DESCRIPTION π¦
This module is a simplified interface to the HidTEMPer thermometers made by PCSensor. What does "simplified" mean here? It means it hides all the messy stuff from you β all the problems with recognizing the correct objects to initialize, and the whole dependency on Device::USB. gone. handled. not your problem anymore. π
To actually use the thermometers you've got connected, you've got two options:
- if you have multiple devices connected, you create an array of objects
- if you have just one device, you use the
device()function
Also, there's an example of this module being used in real life in the Linux Journal August 2010, "Cool Projects edition", page 32-34. published, periodt. π
π CONSTANTS π
These constants are declared:
PRODUCT_IDβ holds the hex value of the product id on the usb chip, which in this case is0x660cVENDOR_IDβ holds the hex value representing the manufacturer of the chip, which in this case is "Tenx Technology, Inc."SUPPORTED_DEVICESβ holds the mapping between name and identifiers for all the supported thermometers. the lineup:- Hex value
0x5bβ productHidTEMPerNTCβ internal sensor: Yes, external sensor: Yes - Hex value
0x58β productHidTEMPerβ internal sensor: Yes, external sensor: No - Hex value
0x59β productHidTEMPer2β internal sensor: Yes, external sensor: Yes
- Hex value
bestie clock the pattern β HidTEMPer is the only one with no external sensor π
π METHODS π
new()β initializes the system, and the USB-connection that's gonna be used. your starting point, your origin story β¨device()β returns a single thermometer instance. ONLY to be used in systems with a single thermometer device, okay?? don't be out here calling it on multi-device setups. Returnsundefif no devices were found.list_devices()β returns an array of recognized thermometer instances if an array value is expected, otherwise it returns a scalar with the number of devices found. context-sensitive queen π
π DEPENDENCIES π
This module internally includes and takes use of the following packages:
use Device::USB;
use Device::USB::PCSensor::HidTEMPer::Device;
use Device::USB::PCSensor::HidTEMPer::NTC;
use Device::USB::PCSensor::HidTEMPer::TEMPer;
use Device::USB::PCSensor::HidTEMPer::TEMPer2;
It also uses the strict and warning pragmas. yes, we're being responsible. we love a module that practices safe code. π«Ά
π BUGS π
Found a bug? Missing a feature? Please report any bugs or missing features using the CPAN RT tool. don't suffer in silence bestie, tell the maintainers.
π₯ FOR MORE INFORMATION π₯
None.
not me writing a whole section to say "None" π iconic honestly
π AUTHOR π
Magnus Sulland < msulland@cpan.org >
π§ ACKNOWLEDGEMENTS π§
Thanks to Elan RuusamΓ€e for fixing some compatibility issues with perl 5.8.
Thanks to Daniel Fahlgren for adding the TEMPer2 device.
shoutout to the contributors, y'all ate π
β COPYRIGHT & LICENSE β
Copyright (c) 2010-2011 Magnus Sulland
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π POD ERRORS π
Hey! The above document had some coding errors, which are explained below:
Around line 205:
Non-ASCII character seen before =encoding in 'RuusamΓ€e'. Assuming
UTF-8
ngl the doc was out here assuming UTF-8 like the rest of us π perl said "sure, we'll allow it"
and that's the whole page, bestie!! this was perl v5.40.0, dated 2024-11-30, straight from the Device...TEMPer(3pm) man page. go forth and read your thermometers π‘οΈβ¨
π¦ where this page comes from
- debian trixie: libdevice-usb-pcsensor-hidtemper-perl 2:0.04-3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu resolute: libdevice-usb-pcsensor-hidtemper-perl 2:0.04-3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu stonking: libdevice-usb-pcsensor-hidtemper-perl 2:0.04-3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms