Coder Social home page Coder Social logo

usblag's Introduction

usblag

Arduino Project to measure USB Controller input lag...optimized.

This is an optimized version of the original lag testing sketch by Loïc WydD Petit. The original version can be found on here: https://gitlab.com/loic.petit/usblag. The remaining README content is directly from the original repository.

Hardware requirement

You need a arduino board with a USB Host Shield properly installed.

Note: if you own a rev1 board (not ICSP connector) be sure to check out the hardware manual to bind the four signals to the right pins.

After that, hook up the desired button signal using the necessary protection like an inverted diode to pin 7 and you're good to go.

Software Installation

Assuming that you have the Arduino IDE, just install the library USB Host Shield Library 2.0 in the Tools > Manage Libraries section. After that, upload the sketch to the board, and open the serial monitor.

Device Support

This contains extra-minimal drivers for HID compliant devices and standard XInput devices (maybe not the latest xbox one stuff thought). Don't hesitate to create an MR if one of your device is not supported.

This program may or may not support hotplugs so be sure to hit the reset button if you switch you device.

Commands

The serial monitor will support different commands to play with your device:

command effect
0 Set the button signal to False
1 Set the button signal to True
t Fire a test of 1000 data points
o Override polling interval to 1ms
2 Override polling interval to 2ms
4 Override polling interval to 4ms
8 Override polling interval to 8ms
p Override polling interval like a PC would do
n Set the polling interval back to normal
sX Override polling interval to Xms
= Displays min/max/avg/stddev from test

Protocol

  • Connect your device
  • Reset the arduino to be sure
  • Note the polling interval
  • Try command 0 and 1 to see if you signal is properly routed to your board. If it works you should see a lag value in ms.
  • Clear output
  • Send the command t... wait
  • Change the polling interval at will and do the experiment again

Don't hesitate to use the google spreadsheet to analyze the results.

Licence

The drivers code are mainly built on extracted code from the USB Host Shield Library 2.0, licenced using GPL2.

The rest of the code is under the MIT Licence.

usblag's People

Contributors

bsas avatar feralai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.