게임/컨트롤러2018. 4. 24. 13:31

음.. 근데 이거는 하나도.. 두개로 나눠진걸 합쳐서 보낼수도 있으려나?


[링크 : https://www.youtube.com/watch?v=1k49VVNHvtU]

[링크 : https://learn.adafruit.com/diy-bluetooth-gamepad/overview]


큭.. 19.95$

좋은 제품이긴 한데 내가 상상한 걸 만들기에는 조금 많이 부족한 듯?

[링크 : https://www.adafruit.com/product/1535]


단순하게 On/Off만 되는 12개 짜리 조이스틱 보드인듯

Control and LEDs

To the right of the power pins, there are some control pins
  • RS - this is the reset pin. To reset the module, pull this pin to ground. It does not affect pairing.
  • L2 - this is the same output that is connected to the PairLED. If you want to put this in a box and have an external Pair indicator LED, wire an LED from this pin, through a 1K resistor, to ground.
  • PB - this is the pair button pin. It is connected to the button onboard that is used to reset the pairing. If you want to make another, external pair button, connect a switch from this key to 3V (not ground!)
  • L1 - this is the same output that is connected to the KeyLED. If you want to put this in a box and have an external Key-press indicator LED, wire an LED from this pin, through a 1K resistor, to ground.
  • RX - this is the UART input, used if you want to send UART->Keypress data, or re-map the buttons. It is 5V compliant, use 3V-5V TTL logic, 9600 baud.
  • TX - this is the UART output, used for watching debug data or re-mapping the buttons. It is 3V logic level output.

[링크 : https://learn.adafruit.com/introducing-bluefruit-ez-key-diy-bluetooth-hid-keyboard/pinouts]



+

HC-05 인지 RN-42인지 잘 모르겠네.. 아무튼 이렇게 설정하면 HID JOYPAD로 인식을 하나보다 ㄷㄷ

    $$$                    //Enter command mode (no CR/LF)

    CMD

    

    SM,6                   //Set Mode = pairing

    AOK

    

    SN,SNESpad             //Set Name

    AOK

    

    S~,6                   //Set profile = HID

    AOK

    

    SH,0240                //Set report descriptor = joypad

    AOK

    

    R,1                    //Reset for settings to take effect.

[링크 : https://mitxela.com/projects/bluetooth_hid_gamepad]


그냥.. BT HID로 설정하고

6바이트 날리면 되는건가?


SoftwareSerial bluetooth(bluetoothRX, bluetoothTX);

//...


// Command Mode

// --------------

bluetooth.begin(9600);

delay(50); 

bluetooth.print("$$$");

delay(50); 

bluetooth.print("SN,HIDJoystick\r\n");

delay(50); 

bluetooth.print(" SU,57\r\n");

delay(50); 

bluetooth.print("S~,6\r\n");

delay(600); 

bluetooth.print("SH,0240\r\n");

delay(200); 

bluetooth.print("R,1\r\n");  

delay(400);


// HID Joystick Report

// --------------

bluetooth.write((byte)0xFD); //Start HID Report

bluetooth.write((byte)0x6);  //Length byte


// 1. X/Y-Axis

bluetooth.write(45);  //First X coordinate

bluetooth.write(-33); //First Y coordinate


// 2. X/Y-Axis

bluetooth.write(45);  //Second X coordinate

bluetooth.write(-33); //Second Y coordinate


// Buttons

bluetooth.write(B10000001); // Second Byte (Buttons 1-8)

bluetooth.write(B10000000); // Second Byte (Buttons 9-16)

[링크 : https://stackoverflow.com/questions/27661297/hid-reports-scan-codes-for-rn-42-hids-gamepad-profile]



+

RN-42

[링크 : http://eleparts.co.kr/goods/view?no=3555519] 48590

[링크 : http://eleparts.co.kr/goods/view?no=2276606]  22600


정확하게는 RN-42로는 안되고(SPP만 지원) RN42HID나 RN42NHID로 된 녀석이 필요하다.

대충 찾아 보는데.. RN42HID로 된 녀석들이 잘 안보이는지라.. 잘못샀다가는 돈만 날릴 듯?

[링크 : http://ww1.microchip.com/downloads/en/DeviceDoc/50002328A.pdf]


+

FB155BC

모델명은 같은데 HID 여부가 다르니 주의 

30000원 / 정찰가 인듯?

[링크 : http://www.eleparts.co.kr/goods/view?no=2161507]

[링크 : http://www.devicemart.co.kr/1065515]

Posted by 구차니