SunOner / HID_Arduino

HID mouse emulation by host shield

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arduino HID mouse

ENG

This repository contains HID mouse emulation for the Sunone Aimbot.

  • To get started, acquire an Arduino Leonardo R3 ATMEGA32U4, ARDUINO USB HOST SHIELD, and a soldering iron if you don't have one.

  • Download and install the Arduino IDE.

  • Download and unpack the repository archive to C:\Users\your_username\Documents\Arduino\HID_Arduino or if you have logitech G-series mouse download this and unpack the repository archive to C:\Users\your_username\Documents\Arduino\hidmousereport

  • Download and unpack this archive into C:\Users\your_username\Documents\Arduino\libraries\USB_Host_Shield_2.0-1.6.2

  • Solder 3 contacts on the board to increase the voltage as shown in the image.


  • Open the file C:\Users\your_username\Documents\Arduino\HID_Arduino\HID_Arduino.ino or C:\Users\your_username\Documents\Arduino\hidmousereport\hidmousereport.ino if you have logitech G-series mouse

  • Connect the ARDUINO USB HOST SHIELD to the Arduino Leonardo and connect the ARDUINO to the PC.

  1. Select the device
  2. Write "leonardo" in the search engine
  3. Select the device
  4. Select the port to which the device is connected
  5. Upload the program to your device

  • Connect the mouse to the host shield.

  • Test the mouse for functionality. If everything works as it should, then you have been successful and lucky with the mouse model. But if something does not work correctly, continue to the next steps. (For logitech G-series tutorial is ends.)

  • Open the file C:\Users\your_username\Documents\Arduino\libraries\USB_Host_Shield_2.0-1.6.2\settings.h in notepad.

  • Change #define ENABLE_UHS_DEBUGGING 0 to #define ENABLE_UHS_DEBUGGING 1

  • Upload the script to the device.

  • In the Arduino IDE, open the Tools->Serial Monitor tab.


  • Select 9600 baud.


  • You should see the data that the mouse sends to the host shield.

  • Switch to the hidcustom.h tab and look at the struct MYMOUSEINFO structure

  • In my case, it looks like this:


  • For me, the mouse button bytes are transmitted first, but your data might be different, like the mouse coordinates on the X-axis, for example.

  • Then you will need to change the structure of MYMOUSEINFO so that the variable uint16_t dX; is at the beginning.

  • In some cases, you will need to change uint16_t on the X axis or uint16_t on the Y axis to uint8_t .

  • Do this with all the output data and normalize the structure.

  • Do not forget to disable the #define ENABLE_UHS_DEBUGGING 0 in settings.h after completing all the steps.

RU

Этот репозиторий содержит HID эмуляцию мыши для ИИ Аимбота.

  • Для начала приобритите Arduino Leonardo R3 ATMEGA32U4, ARDUINO USB HOST SHIELD и паяльник если его нет.

  • Скачайте и установите Arduino IDE.

  • Скачайте и распакуйте архив скачанный с репозитория в C:\Users\ваше_имя_пользователя\Documents\Arduino\HID_Arduino или если у вас мышка logitech G-серии скачайте this и распакуйте скачанный архив с репозитория в C:\Users\ваше_имя_пользователя\Documents\Arduino\hidmousereport

  • Скачайте и распакуйте этот архив и распакуйте в C:\Users\ваше_имя_пользователя\Documents\Arduino\libraries\USB_Host_Shield_2.0-1.6.2

  • Спаяйте на плате 3 контакта чтобы получилось как на изображении. (Для увеличения напряжения)


  • Откройте файл C:\Users\ваше_имя_пользователя\Documents\Arduino\HID_Arduino\HID_Arduino.ino или C:\Users\ваше_имя_пользователя\Documents\Arduino\hidmousereport\hidmousereport.ino если у вас мышка logitech G-серии

  • Подключите плату ARDUINO USB HOST SHIELD к Arduino Leonardo и подключите к ПК ARDUINO.

  1. Выберите устройство
  2. Напишите в поисковике "leonardo"
  3. Выберите устройство
  4. Выберите порт к которому подключено устройство
  5. Загрузите программу на устройство

  • Подключите мышь к host shield.

  • Проверьте мышь на работоспособность. Если всё работает как нужно то у вас всё получилось и повезло с моделью мыши. Но если что-то работает не правильно вам дальше. (Для logitech G-серии дальнейшие действия не требуются.)

  • Откройте в блокноте файл C:\Users\ваше_имя_пользователя\Documents\Arduino\libraries\USB_Host_Shield_2.0-1.6.2\settings.h

  • Измените #define ENABLE_UHS_DEBUGGING 0 на #define ENABLE_UHS_DEBUGGING 1

  • Загрузите скрипт на устройство.

  • В Arduino ide откройте вкладку Tools->Serial Monitor.


  • Выберите 9600 baud


  • Вы должны увидеть данные которые пересылает мышка на host shield.

  • Переключитесь на вкладку hidcustom.h и взгляните на структуру struct MYMOUSEINFO

  • В моем случаи это выглядит так:


  • У меня в начале пересылаются байты кнопок мыши, но у вас может пересылаться что-то другое, к примеру координаты мыши по X-горизонтали.

  • Тогда вам нужно будет изменить структуру MYMOUSEINFO так что-бы в начале стояла переменная uint16_t dX;.

  • В некоторых случаях нужно будет изменить uint16_t по оси X или uint16_t по оси Y на uint8_t .

  • Проделайте это со всеми выходными данными и приведите структуру в норму.

  • Не забудьте отключить после всех проделанных действий #define ENABLE_UHS_DEBUGGING 0 в settings.h.

About

HID mouse emulation by host shield


Languages

Language:C++ 100.0%