コード例 #1
0
ファイル: main.c プロジェクト: jokkebk/TrinketKeyboard
int main() {
	usbBegin();
	PORTB |= _BV(PB0); // Pullup on button

    while(1) {
        usbPoll();

		if(!(PINB & _BV(PB0))) { // button pressed
            pressKey(KEYCODE_MOD_LEFT_SHIFT, KEYCODE_A); // press
            pressKey(0, 0); // release
        }
    }
	
    return 0;
}
コード例 #2
0
ファイル: TrinketMouse.cpp プロジェクト: AGoodnight/Arduino
// starts the USB driver, causes re-enumeration
void Trinket_Mouse::begin()
{
	usbBegin();
}