MCP23017 i2c 4.7k or 10k resistor? #1067
Replies: 2 comments 2 replies
-
I'm afraid a discussion of I²C pull-up resistor strength is beyond the scope of this project, but you can find guidelines online, e.g. https://www.ti.com/lit/an/slva689/slva689.pdf. If you want 16 encoders, you'll have to create multiple instances of the MCPEncoderType encs[2]{
{Wire, 0x0, 12}, // Make sure they have different addresses
{Wire, 0x1, 12},
};
CCMCPEncoder ccencoders[] {
{encs[0][0], {MCU::V_POT_1, Channel_1}},
{encs[0][1], {MCU::V_POT_2, Channel_1}},
{encs[0][2], {MCU::V_POT_3, Channel_1}},
{encs[0][3], {MCU::V_POT_4, Channel_1}},
{encs[0][4], {MCU::V_POT_5, Channel_1}},
{encs[0][5], {MCU::V_POT_6, Channel_1}},
{encs[0][6], {MCU::V_POT_7, Channel_1}},
{encs[0][7], {MCU::V_POT_8, Channel_1}},
{encs[1][0], {MCU::V_POT_1, Channel_2}},
{encs[1][1], {MCU::V_POT_2, Channel_2}},
{encs[1][2], {MCU::V_POT_3, Channel_2}},
{encs[1][3], {MCU::V_POT_4, Channel_2}},
{encs[1][4], {MCU::V_POT_5, Channel_2}},
{encs[1][5], {MCU::V_POT_6, Channel_2}},
{encs[1][6], {MCU::V_POT_7, Channel_2}},
{encs[1][7], {MCU::V_POT_8, Channel_2}},
};
void setup() {
Control_Surface.begin();
Wire.begin(); // Must be called before enc.begin()
Wire.setClock(800000);
for (auto &enc : encs)
enc.begin(); // Initialize the MCP23017
}
void loop() {
for (auto &enc : encs)
enc.update();
Control_Surface.loop();
} |
Beta Was this translation helpful? Give feedback.
-
hi, sorry for the hypernoob question that im going to do, but, i need some help, i conect the mcp23017 to an arduino pro micro i2c via (2 scl, 3 sda) its really necesary put the resistors into both wires? can someone helpme with a simple conecction esquematic? im really lost XD. |
Beta Was this translation helpful? Give feedback.
-
Hi, firstable, i will congra this team or guy for this awesome job, its a really nice librery, im a bit new on that, and i will know how to conect the mcp23017 (i2c via) to arduino pro micro, i know sda and clk wires into arduino respectly, but, on couple of forums said that i need conect resistor between both wires 4.7 o 10k? its a really noob question and sorry for that, another question its, if i need 2 mcp23017 (i wanna conect 16 encoders) and i saw this code
"MCPEncoderType enc {Wire, 0x0, 12};
// │ │ └─ Interrupt pin
// │ └────── Address offset
// └──────────── I²C interface
// Instantiate 8 MIDI rotary encoders.
CCMCPEncoder ccencoders[] {
{
enc[0], // The encoder to use
MCU::V_POT_1, // The MIDI address
1, // Encoder speed multiplier
4, // Number of pulses per physical "click" of the encoder
},
{enc[1], MCU::V_POT_2},
{enc[2], MCU::V_POT_3},
{enc[3], MCU::V_POT_4},
{enc[4], MCU::V_POT_5},
{enc[5], MCU::V_POT_6},
{enc[6], MCU::V_POT_7},
{enc[7], MCU::V_POT_8},
};
void setup() {
Control_Surface.begin();
Wire.begin(); // Must be called before enc.begin()
Wire.setClock(800000);
enc.begin(); // Initialize the MCP23017
}" i need create 2 instance of this? sorry i am new, and thanks for the pacience
Beta Was this translation helpful? Give feedback.
All reactions