sending multiple bytes from slave over i2c

i have been able to send string of multiple chars across i2c between my arduinos, but am having alot of trouble sending multiple ints.

do you have to put them in a matrix ?

i know it probably has something to do with the Wire.send(data, quantity) can someone give me a solid example.

Ok, sorry for the flack,

i think my problem more specifically, is how to turn my array of integers into an array of uint8_t*

how to turn my array of integers into an array of uint8_t*

You can use the fact that any variable or constant you define, large or small, array or structure is laid out in memory as a sequential string of bytes. If you take the memory address of the first byte of this variable and pass it to Wire.send along with a quantity you’re good to go.

Here are some examples:

#include <Wire.h>

  int var1; // single integer, 2 bytes total

  int arr1[4]; // 4 element integer array, 8 bytes total

  struct {  // 2 16-bit integers, 4 bytes total
    int val1;
    int val2;
  } str1;

void setup()
{
  Wire.send((uint8_t *)&var1, sizeof(var1));
  Wire.send((uint8_t *)arr1, sizeof(arr1));
  Wire.send((uint8_t *)&str1, sizeof(str1));
}

void loop()
{
}