-/* Arduino USB Joystick HID demo */
-/* Author: Darran Hunt, 
-*/
-
 /* 
 Mega2560 R3, digitalPin 22~ 37 used as row0 ~ row 15, 
 digital pin 38~53 used as column 0 ~ 15,

		}
	}

	for ( int rowid = 4; rowid < 16; rowid ++ )
	{
		//turn off all rows first
		PORTA = 0xFF;  PORTC = 0xFF;
		//turn on the current row
		if (rowid < 8)
		{
			PORTA &= ~(0x1 << rowid);
		}
		else
		{
			PORTC &= ~(0x1 << (16 - rowid) );
		}
		//digitalWrite( rowid + 22, LOW );
		byte colResult[16];
		//pin 38, PD7
		colResult[0] = (PIND & B10000000)== 0 ? 1 : 0;

// Send an HID report to the USB interface
void sendJoyReport(struct joyReport_t *report)
{
	//check if time has elapsed enough time since last report sent.
	long static prevMillis;
	if ( millis() - prevMillis >= 10 )
	{
