VersaLogic Komodo VL-EPICs-36 Reference Manual page 31

Table of Contents

Advertisement

while
(keypressed
{
if
(kbhit())
{
keypressed
= getch();
}
/*
Read FanTach1 LSB first, latches MSB.
outp( Bindex,
FANTACHREG
FTraw
= inp(
Bdata
outp( Bindex,
FANTACHREG
FTraw
+= inp(
Bdata
/* FTraw now contains the number of 90KHz pulses it took to find 5 tach edges.
(5 edges = 2 tach pulses = 1 revolution)
/*
Convert Raw to RPMs...
RPM = 1 / (FTraw * 11.11uS / 2) * 60
fanRPM
=
FTraw
* 0.00001111;
fanRPM
/= 2;
fanRPM
= 1/fanRPM;
_settextposition(4,1);
if
(
fanRPM
>
0
{
printf
(
"FanTach 1: %5.0fRPMs
delay(100);
}
else
{
printf
(
"FanTach 1: Stalled! \n"
delay(100);
}
}
exit
(
0
);
}
VL-EPICs-36 Reference Manual
!= ESC)
);
);
+
1
);
) << 8;
)
//Fantach 1 LSB
//Fantach 1 MSB
\n",fanRPM*60
);
);
System Features
*/
*/
*/
25

Advertisement

Table of Contents
loading

Table of Contents