旋鈕製作 http://mowei-tw.blogspot.tw/2015/06/kshootmania.html V-USB 電路接法參考 http://coopermaa2nd.blogspot.tw/2011/10/v-usb-examples-for-arduino.html D+ , D- 改接成下面 D+ 接腳2 D- 接腳3 按鈕4~10腳 導通到GND觸發 10接腳分 短按 長按 1秒當作分隔 A0,A1一個旋鈕 A2,A3一個旋鈕 程式碼&hex: https://www.dropbox.com/s/j6nek8wpndflp4b/KshootJOY.rar?dl=0 #include "UsbJoystick.h" class rotaryDevice { private: int analogInPin[2]; int newValue[2]; int oldValue[2]; int rotarytrigger; unsigned long rotarytime; public: rotaryDevice(int Pin, int Pin1) { analogInPin[0] = Pin; analogInPin[1] = Pin1; rotarytrigger = 0; rotarytime = 0; oldValue[0] = analogRead(analogInPin[0]); oldValue[1] = analogRead(analogInPin[1]); } int rotaryChanged() { newValue[0] = analogRead(analogInPin[0]); newValue[1] = analogRead(analogInPin[1]); int rotaryresult = rotary(); if (rota...