I do not know if this is the right place to ask this, but did not know so well where else...
I have an ADAFRUIT FEATHER M0 BLUEFRUIT LE shield. This works well. Now, however, I want to extend this shield with more pins. I personally want to connect an Arduino MEGA, and then that i use the extra pins.
Does anyone have experience with this? I look forward to your response.
Project guidance would probably have been more appropriate 
I see SPI and I2C pins on it so for digital SPI or I2C port expanders come to mind. And for analog just some multiplexers.
sterretje:
Project guidance would probably have been more appropriate 
I see SPI and I2C pins on it so for digital SPI or I2C port expanders come to mind. And for analog just some multiplexers.
Did you maby already work with this? So yes, do you have a example program? 
I want to extend this shield with more pins
Is this actually a shield or is it a combined Arduino and Bluetooth board ? If so, then you could connect it to a Mega and communicate between the two using one of the available interfaces.
UKHeliBob:
Is this actually a shield or is it a combined Arduino and Bluetooth board ? If so, then you could connect it to a Mega and communicate between the two using one of the available interfaces.
I put a photo in the attachment. I was now trying to figer out how I2C works.... Help is welcome

Okay, I'm slowly starting to understand I2C. However, there are still a few things that I do not fully understand.
I use the following code:
Master
//master
#include <Wire.h>
void setup() {
Wire.begin(); // join i2c bus (address optional for master)
Serial.begin(9600); // start serial for output
}
void loop() {
Wire.requestFrom(8, 9); // request 6 bytes from slave device #8
while (Wire.available()) { // slave may send less than requested
char c = Wire.read(); // receive a byte as character
Serial.println(c); // print the character
}
delay(500);
}
Slave
//slave
#include <Wire.h>
#define counter 5
void setup() {
Wire.begin(8); // join i2c bus with address #8
Wire.onRequest(requestEvent); // register event
}
void loop() {
delay(100);
}
// function that executes whenever data is requested by master
// this function is registered as an event, see setup()
void requestEvent() {
Wire.write("123456789"); // respond with message of 6 bytes
// as expected by master
}
The code is [Master Reader / Slave Sender](http://https: //www.arduino.cc/en/Tutorial/MasterReader)
I saw that there was also [Master Writer / Slave Receiver](http://https: //www.arduino.cc/en/Tutorial/MasterWriter)
Questions
- Does it matter which device is the Master? Because personally I find Master Reader / Slave Sender clearer than Master Writer / Slave Receiver.
- With the slave pogramma you say Wire.begin (address). Can I also use two different addresses to send data. These would, for example, be linked to different variables.
- You specify at master Wire.requestFrom (address, bytes). If I do not know how many bytes are, how could I solve that?
I am curious about your input. In the attachment I put a small sketch with what I eventually want to achieve.
- Does it matter which device is the Master? Because personally I find Master Reader / Slave Sender clearer than Master Writer / Slave Receiver.
You basically can have one master (multi master is possible though).
Depending on the device that you're talking to, you might need both Master Reader / Slave Sender and Master Writer / Slave Receiver. In e.g. an eeprom (the slave) you want to be able to write data and you want to be able to read it back; or you Mega might want to read from and write to your Feather (assuming Feather is the slave).
- With the slave pogramma you say Wire.begin (address). Can I also use two different addresses to send data. These would, for example, be linked to different variables.
Not sure I understand what you want to achieve; but I suspect that you need to write some protocol.
Going back to the eeprom, the master e.g. first tells the slave "Hey I want you to store this in memory location X" (a write to the slave) and next gives the slave the data to store (another write to the slave). Or it tells the slave "Give me the data at location X" (a write to the slave) and next reads the data from the slave.
- You specify at master Wire.requestFrom (address, bytes). If I do not know how many bytes are, how could I solve that?
If you don't know how many bytes, it will not work. So you need to implement a mechanism where the slave can tell you how many bytes there are before you can read the actual bytes.
It gets a little outside my knowledge; I just know the basics.
Thank you for your respond.
sterretje:
If you don't know how many bytes, it will not work. So you need to implement a mechanism where the slave can tell you how many bytes there are before you can read the actual bytes.
What should I imagine this?
As said, a little outside my league for the implementation but the general idea
master writes a command to slave (e.g. 0x01)
slave knows that this means: give me number of available bytes
master sends read request to slave to get the reply (read one byte)
master read the reply and remembers the number
master sends e.g. command 0x02 to slave
slave knows what this means: give me the bytes on the next read request
master sends read request (for number of bytes indicated in first step)
master reads the reply and stores the data in an array of sufficient size.
There might be other ways.
I did it. Just strike on the fact that I can not send larger numbers yet, but I will create a new topic for that question.
thanks for your help