Edit: When you increment a floating point number, what's the new value? In other words, what does
encoderValue++;
do?
well i was playing with this i was trying to get it to add 0.1 on to the current value (obviously it does not do that).
i did try this but it did not like it:
encoderValue + 0.1;
You are pushing an encoder?
no just two push buttons
but the code did originate from using encoder
am i going about this the right way or is there some other way what could be better and easier?
all working now but like you lot send it is now bouncing am i better looking at the Debounce on my ide? or is there something better?
also i would like to cycle though it fast if i push and hold how could i do that?
pinMode(encoderPin1, INPUT_PULLUP);
pinMode(encoderPin2, INPUT_PULLUP);
//digitalWrite(encoderPin1, HIGH); //turn pullup resistor on ?? this may be specific to some hardware??
//digitalWrite(encoderPin2, HIGH); //turn pullup resistor on
attachInterrupt(0, updatebuttonUP , FALLING);
attachInterrupt(1, updatebuttonDOWN, FALLING);
Hope you plan to do debounce in ISR itself AKA delay re-trigger.
also i would like to cycle though it fast if i push and hold how could i do that?
Yes if one of your button terminal is connected to pin and the other button terminal to ground.
meaning in the examples Debounce
I'll get back to you on that one , I am having some issues running / monitoring plain machine delay for loop
in ISR.
Simple for( long c = 0 ; c != 0XFFFFFFF;c++) delays only 1us on Due, but cascading another for loop gives unexpected and wrong delay. ( about 4 seconds)