ICP DAS USA 3-axis encoder card, 2-axis stepping/servo Computer Hardware User Manual


 
I-8090 User Manual Version 1.0 06/2001
http://www.icpdas.com 1-25 ICPDAS
{
Delay(5); //delay 5ms
//---------------------------------------------------
// i8090_ENCODER32_ISR(CARD1) should be called in 2~10ms
// or call it by a timer interrupt service routine by 2~10ms
//---------------------------------------------------
i8090_ENCODER32_ISR(CARD1);
//---------------------------------------------------
x_value = i8090_GET_ENCODER32(CARD1, X_axis);
y_value = i8090_GET_ENCODER32(CARD1, Y_axis);
z_value = i8090_GET_ENCODER32(CARD1, Z_axis);
index = i8090_GET_INDEX(CARD1);
x_index = index & 0x01;
y_index = (index & 0x02) >> 1;
z_index = (index & 0x04) >> 2;
if (IsSystemKey())
{
key=GetSystemKey();
ClearSystemKey();
switch (key)
{
case SKEY_DOWN:
ShowAxis++;
if (ShowAxis>2) ShowAxis=0;
break;
case SKEY_UP:
ShowAxis--;
if (ShowAxis<0) ShowAxis=2;
break;
};
}