You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/Arduino-Helpers/Hardware/MCP23017-Encoders/MCP23017-Encoders-Interrupts/MCP23017-Encoders-Interrupts.ino
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -49,13 +49,13 @@
49
49
* https://github.com/tttapa/Arduino-Helpers
50
50
*/
51
51
52
+
#include<Wire.h>
53
+
52
54
#include<Arduino_Helpers.h>
53
55
54
56
#include<AH/Hardware/MCP23017Encoders.hpp>
55
57
#include<AH/PrintStream/PrintStream.hpp>
56
58
57
-
#include<Wire.h>
58
-
59
59
using WireType = decltype(Wire); // The type of I²C driver to use
60
60
using EncoderPositionType = int32_t; // The type for saving encoder positions
61
61
constexprbool IntSafe = true; // Make it safe to call `update` in an ISR
@@ -82,7 +82,7 @@ void setup() {
82
82
83
83
voidloop() {
84
84
// No `enc.update()` here, everything happens inside of the ISR
85
-
85
+
86
86
// Save the previous positions
87
87
static EncoderPositionType prevPositions[8] {};
88
88
// Check if an encoder position changed and print it
Copy file name to clipboardExpand all lines: examples/Arduino-Helpers/Hardware/MCP23017-Encoders/MCP23017-Encoders-No-Interrupts/MCP23017-Encoders-No-Interrupts.ino
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -47,13 +47,13 @@
47
47
* https://github.com/tttapa/Arduino-Helpers
48
48
*/
49
49
50
+
#include<Wire.h>
51
+
50
52
#include<Arduino_Helpers.h>
51
53
52
54
#include<AH/Hardware/MCP23017Encoders.hpp>
53
55
#include<AH/PrintStream/PrintStream.hpp>
54
56
55
-
#include<Wire.h>
56
-
57
57
using WireType = decltype(Wire); // The type of I²C driver to use
58
58
using EncoderPositionType = int32_t; // The type for saving encoder positions
59
59
using MCPEncoderType = MCP23017Encoders<WireType, EncoderPositionType>;
0 commit comments