19
19
#include < TaskManagerIO.h>
20
20
21
21
// The pin onto which we connected the rotary encoders switch
22
- const int spinwheelClickPin = 4 ;
22
+ const int spinwheelClickPin = 7 ;
23
23
24
24
// The two pins where we connected the A and B pins of the encoder. I recomend you dont change these
25
25
// as the pin must support interrupts.
26
- const int encoderAPin = 5 ;
27
- const int encoderBPin = 6 ;
26
+ const int encoderAPin = 3 ;
27
+ const int encoderBPin = 4 ;
28
28
29
29
//
30
30
// When the spinwheel is clicked, this function will be run as we registered it as a callback
@@ -55,7 +55,7 @@ void setup() {
55
55
// First we set up the switches library, giving it the task manager and tell it to use arduino pins
56
56
// We could also of chosen IO through an i2c device that supports interrupts.
57
57
// If you want to use PULL DOWN instead of PULL UP logic, change the true to false below.
58
- switches.initialise (internalDigitalIo ( ), true );
58
+ switches.initialise (asIoRef ( internalDigitalDevice () ), true );
59
59
60
60
// now we add the switches, we dont want the spinwheel button to repeat, so leave off the last parameter
61
61
// which is the repeat interval (millis / 20 basically) Repeat button does repeat as we can see.
@@ -66,7 +66,7 @@ void setup() {
66
66
// when we do this, the callback either gets 0 no change, -1 down or 1 up.
67
67
// The easiest way to configure direction mode is by setting the user intention as below.
68
68
setupRotaryEncoderWithInterrupt (encoderAPin, encoderBPin, onEncoderChange);
69
- switches.getEncoder (0 )->setUserIntention (DIRECTION_ONLY);
69
+ switches.getEncoder ()->setUserIntention (DIRECTION_ONLY);
70
70
}
71
71
72
72
void loop () {
0 commit comments