#! /usr/bin/perl # hipicpustats.pl - Display CPU Temp, CPU Utilization, and Memory Utilization # James M. Lynes, Jr. - KE4MIQ # Created: June 14, 2020 # Last Modified: 06/14/2020 - Initial version based on the RPi::SysInfo distribution # By Steve Bertrand # # Notes: RPi::SysInfo is not dependant on RPi::WiringPi # and can be used eventhough WiringPi has been deprecated. # use strict; use warnings; use HiPi qw( :rpi ); # Not used in this test code use HiPi::GPIO; # Not used in this test code use RPi::SysInfo; my $cpu = RPi::SysInfo->new; # create a SysInfo Object while(1) { print "Cpu %: $cpu->cpu_percent\n"; print "Mem %: $cpu->mem_percent\n"; print "Cpu TempC: $cpu->core_temp()\n"; print "Cpu TempF: $cpu->core_temp('f')\n"; sleep(3); }