novski Posted July 19, 2012 Report Share Posted July 19, 2012 (edited) Hi Im trying to decrease a Encoder just in Software for a reason of a Menu that has to be chosen before i can edit the parameters manualy. What i tried is to start this on pressing a button: } else if( button_id < 0x7f ) { // Range SAC_Special ENC_NotifyChange(8,2) } the 8 is meant for the Encodernumber i need to decrease for 2 Detents. and i thought that it will jump to Main.c where this is the Encoder function: void ENC_NotifyChange(unsigned char encoder, char incrementer) __wparam well, the main question is: how can i decrease a Enc. virtualy? Thanks for help Best regards novski Edited July 19, 2012 by novski Quote Link to comment Share on other sites More sharing options...
novski Posted July 19, 2012 Author Report Share Posted July 19, 2012 Well as usual... as soon as i give up, i find the solution I'm searching for ages. // 0x58..0x7f could be used for other purposes } else if( button_id < 0x7f ) { // Range SAC_Special MM_VPOT_SendJogWheelEvent(-1); } That helps to decrease. But it decreases 3 clicks, not one. Does somebody know how to make smaller steps? Quote Link to comment Share on other sites More sharing options...
TK. Posted July 22, 2012 Report Share Posted July 22, 2012 You have to check if the button has been pressed (pin_value == 0): if( pin_value == 0 ) { MM_VPOT_SendJogWheelEvent(-1); } [/code] this explains why it would be decremented twice before. It doesn't explain why it has been decremented 3 ticks... but maybe this was just a wrong observation? Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.