12 years, 5 months ago.

how do i make function for this command

Hello, I got my program working with this codeline:

i2c.write(addr, 0x00, 1, 0);

i want to make a function out of out, it will be more lines but so its re-usable. i tried this one:

int main{
 writePointer(char(0x00));
}


void writePointer(char pointerwaarde)
{
i2c.write(addr, &pointerwaarde, 1, 0);
}


//and i tried this one:


void writePointer(char pointerwaarde)
{
char help[1];
help[0]=pointerwaarde;
i2c.write(addr, hulp, 1, 0);
}

both wont work and they both seem fine to me anybody has ideas? thnx in advance

1 Answer

12 years, 5 months ago.

fixed no need anymore, dont undestand how but it works now :)

Accepted Answer