 Psx psxA;
 Psx psxB;
 
-unsigned int refDataA = 0;
-unsigned int refDataB = 0;
-
 void setup()
 {
   // setupPins(dataPin, cmndPin, attPin, clockPin, delay_microseconds);

  Serial.begin(115200);
}

unsigned int update(byte pad, unsigned int data, unsigned int refData) {
  if (data != refData) {
    Serial.write(0xAA);
    Serial.write(pad);
    Serial.write(data & 0x000F);

//    Serial.print("0");
//    Serial.print((data & 0x0F00) >> 8);
//    Serial.println("FF");
}

void loop()
{
  update(PAD_A, psxA.read() & 0x0F0F);
  update(PAD_B, psxB.read() & 0x0F0F);
  
  delay(20);
}
