You are not logged in.

#1 2016-10-22 18:13:28

k4li
Member
From: Ljubljana
Registered: 2016-04-16
Posts: 25

cpu temperature checker in C

Hi,

I made this simple temperature checker in C and I am intersted
about what you think about it. Id dynamically displays cpu temperatures and draws a movable
indicator:

Pac. temp: 22.00 [|||       ]
Core0: 18.00 [||        ]
Core1: 18.00 [||        ]
Core2: 18.00 [||        ]
Core3: 17.00 [||        ]


it is available form: panzerkampfwagen.eu.org/code/temp/temp.zip

Thanks

Offline

#2 2016-10-22 18:59:03

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: cpu temperature checker in C

The hardcoded path doesn't work reliably. You may want to check out how lm_sensors does it.

`watch sensors` is what I use to monitor CPU temperature.


This silver ladybug at line 28...

Offline

#3 2016-10-22 19:09:05

k4li
Member
From: Ljubljana
Registered: 2016-04-16
Posts: 25

Re: cpu temperature checker in C

lolilolicon wrote:

The hardcoded path doesn't work reliably. You may want to check out how lm_sensors does it.

`watch sensors` is what I use to monitor CPU temperature.

I know, the problem with hardcosded paths is in the motherboard ( on better motherboards it's sensors fill the hwmon0, and cpu takes the hwmon1 folders)
I was thinking about thaking the path as an argument along with hyperthreading. Any toughts?

Offline

#4 2016-10-23 04:34:13

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: cpu temperature checker in C

This is a case where, ideally, it should "just work": Have the tool figure it out, don't ask me!
I don't know, but if there were any portable way to get this info, I'd use that.
Otherwise, I'd prefer a compile time setting: Alright, tool, I'll figure this out for you, but don't ask me again!


This silver ladybug at line 28...

Offline

#5 2016-11-07 21:29:39

mikaelbrun
Member
From: Tistedal/ Norway
Registered: 2016-01-01
Posts: 43

Re: cpu temperature checker in C

I thought that hwmon acted in a certain way when creating the path's, but when I reinstalled hwmon, the cpu was changed from hwmon1 to somewhere else, so it's kind of random where you will find the cpu-properties in hwmon. But I don't know the programming part. Just my experience with hwmon smile

Offline

Board footer

Powered by FluxBB