CTemp Source |
|
conundrum
尊榮會員 發表:893 回覆:1272 積分:643 註冊:2004-01-06 發送簡訊給我 |
http://strip.se/prog/ctemp_src.html procedure TMainForm.Timer1Timer(Sender: TObject); var S: Array[0..6] of single; Volt: string; T: integer; i: real; mtm: integer; ts: integer; tm: integer; ct: integer; temp: real; begin Timer1.Interval := RefTime * 1000; {Get Voltage values into array} Port[$295] := $60; For T:=0 to 6 do begin S[T] := port [$296]; end; {Calculate and display VCore} str((Round(S[VCorePort] * 0.16) / 10):3:1,Volt); VCoreLBL.caption := Volt ' V'; {Calculate and display 3.3Volt} str((Round(S[2] * 0.16) / 10):3:1,Volt); Pos33LBL.caption := Volt ' V'; {Calculate and display 5.0Volt} str((Round(S[3] * 0.16 * 1.68) / 10):3:1,Volt); Pos50LBL.caption := Volt ' V'; {Calculate and display 12.0Volt} str((Round(S[4] * 0.16 * 3.8) / 10):3:1,Volt); Pos12LBL.caption := Volt ' V'; {Calculate and display -12.0Volt} str(-(Round(S[5] * 0.16 * 3.47) / 10):3:1,Volt); Neg12LBL.caption := Volt ' V'; {Calculate and display -5.0Volt} str(-(Round(S[6]* 0.16 * 1.5) / 10):3:1,Volt); Neg50LBL.caption := Volt ' V'; {Read MBtemperature} Port[$295] := $27; i := port [$296]; if Scale = 'Farenheit' then begin i := (i * 1.8) 32; str(i:3:1,MBTemp); MBTempLabel.caption := MBTemp ' °F'; end; if Scale = 'Celsius' then begin str(i:3:1,MBTemp); MBTempLabel.caption := MBTemp ' °C'; end; end; {Read CPUTemperature} mtm :=10; ts:=port[$e800] ; tm:=0; while (((ts and 1) = 1)and (tm < mtm)) do begin ts:=port[$e800]; tm := tm 1; end; if (tm >= mtm) then CPUTempLabel.caption := 'LM78 Err'; tm:=0; if (((ts and $1e) <> 0)and (tm < mtm)) then begin port[$e800]:=ts; tm:=tm 1; end; if (tm >= mtm) then CPUTempLabel.caption := 'LM78 Err'; port[$e803]:=0; port[$e804]:=$93; ct:=port[$e802]; ct:=(ct and $e0)or $c; port[$e802]:=ct; port[$e802]:=ct or $40; tm:=0; while (((port[$e800] and 1)= 1) and ( tm < mtm)) do tm:=tm 1; if (tm >= mtm) then CPUTempLabel.caption := 'LM78 Err' ; temp:= port[$e805] ; ts := port[$e806] ; ts:= ts shr 7; ts := ts and 1; if (ts = 1) then temp:= temp 0.5; if Scale = 'Farenheit' then begin temp := temp * 1.8 32; temp := temp Calib; str(i:3:1,MBTemp); str(temp:3:1,CPUTemp); CPUTempLabel.caption := CPUTemp ' °F'; end; if Scale = 'Celsius' then begin temp := temp Calib; str(temp:3:1,CPUTemp); CPUTempLabel.caption := CPUTemp ' °C'; end; End; |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |