Hi,
now I'm trying to expand to using two touchpads, but I'm having a problem differentiating between the values of the two. I made a try in the code below but SuperCollider, which Im using to interpret the values, is sometimes mixing them up. By dumping "first" and "second" before the values from the respective touchpad I route the coming values in SuperCollider to control two different objects..
What would be ideal is to be able to send a DUMP with a different name than "packet->x", like "packet->x2" (or a name I write) for the second touchpad, then I can easily grab it in SuperCollider.
so, this is how my loop{} looks now:
void loop()
{
static packet_t oldPacket;
static packet_t oldPacket2;
packet_t * packet;
packet = t.getNewPacket();
if(!packetsEqual(&oldPacket, packet)) {
DUMP("first");
DUMP(packet->x);
DUMP(packet->y);
//DUMP(packet->z);
//DUMP(packet->w);
DUMP(packet->leftButtonDown);
DUMP(packet->rightButtonDown);
Serial.print("\n");
#if ANSI_TERMINAL
Serial.print(0x1B,BYTE);
Serial.print("[H");
#endif
Serial.print("\n");
// copy the current packet
oldPacket = *packet;
}
packet = t2.getNewPacket();
if(!packetsEqual(&oldPacket2, packet)) {
DUMP("second");
DUMP(packet->x);
DUMP(packet->y);
//DUMP(packet->z);
//DUMP(packet->w);
DUMP(packet->leftButtonDown);
DUMP(packet->rightButtonDown);
Serial.print("\n");
#if ANSI_TERMINAL
Serial.print(0x1B,BYTE);
Serial.print("[H");
#endif
Serial.print("\n");
// copy the current packet
oldPacket2 = *packet;
}
}
cheers!
g