![]() Each Teensy reads its ID as a binary coded number on boot based on the jumper configuration. The address or device index for each Teensy is programmed using a set of jumpers selective pulling down GPIO pins 2-5. A second set of headers allows these boards to be daisy chained to easily add additional Teensys. Note that the Teensys receive power via USB, but share a common ground with the Raspberry Pi. Each board holds four Teensy LCs, with headers for ground and serial RX. The first design is a single-sided prototype suitable for milling on a desktop CNC machine. To simplify connecting all the RX lines together to the Raspberry Pi's serial TX, we designed a simple carrier board. The Teensys listen for incoming command on a common serial bus. On an Android phone running the driver station app, XInput devices will appear as Xbox 360 controllers. Also, XInput is a Microsoft API, so boards running with the XInput library will not be detected as joysticks on Mac or Linux computers without additional software. Note that the XInput library requires additional installation procedures, but can run on either Arduino or Teensy boards. The firmware is written to run on both Teensy boards via the Teensyduino Joystick API and Arduino boards via the Arduino XInput library. For testing, you can add the -dummy-serial option to skip connecting to a physical serial port. Run server script with pipenv run python3 server/gamepad_bridge_server.py /dev/serial0, replacing /dev/serial0 with the appropriate serial UART for your system. Run pipenv install on first clone to download and install Python dependencies. This project uses pipenv to manage dependencies. ![]() ![]() Press the Connect button to establish connection to the server.If you are using the Logitech F310 controller, make sure the switch on the back is set to "D" before plugging it into your computer. Then connect a gamepad to your computer and press some buttons so the browser can detect it.Enter the address and port of the server you wish to connect to.The client webpage uses the Javascript Gamepad API, which is sufficiently supported by most modern browsers. Bridge USB gamepads over IP to enable FTC remote operation ClientÄownload the client page (right click -> Save As) and open in a browser. ![]()
0 Comments
Leave a Reply. |