Version 1.0 06/2001 |
{
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:
if (ShowAxis<0) ShowAxis=2; break;
};
}
http://www.icpdas.com | ICPDAS |