This fork has the following modifications done to it:
- Fetching analog values using ResponsiveAnalogRead library for less noisy reads
- Joystick inputs for Arduino instead of keyboard using Arduino Joystick Library
- PSX functionaly added using veroxzik's PSX Library
- Modified React WebUI to support more panels
A complete software package for FSR dance pads.
Join the discord for any questions/suggestions
- React web UI to customize sensitivity
- Profiles & persistence
- Light support
- A Teensy or Arduino
- uses native keyboard library for Arduino and Joystick library for Teensy
- Python 3.7+
- virtualenv
- Node 12+
- yarn
Follow a guide like fsr-pad-guide or fsr to setup your Arduino/Teensy with FSRs.
- Install Arduino IDE (skip this if you're using OSX as it's included in Teensyduino)
- Install Arduino Joystick Library if using an Arduino Leonardo or related clones.
- Install Teensyduino and get it connected to your Teensy and able to push firmware via Arduino IDE
(The next three steps are for Teensy)
4. In Arduino IDE, set the Tools
> USB Type
to Serial + Keyboard + Mouse + Joystick
(or Serial + Keyboard + Mouse
)
5. In Arduino IDE, set the Tools
> Board
to your microcontroller (e.g. Teensy 4.0
)
6. In Arduino IDE, set the Tools
> Port
to select the serial port for the plugged in microcontroller (e.g. COM5
or /dev/something
)
- Load fsr.ino in Arduino IDE.
- By default, A0-A7 are the pins used for the FSR sensors in this software, corresponding to 8 buttons on a DDR softpad. To add or remove more, alter the Sensor array and number of buttons you will need
- Refer to the following lines and the ResponsiveAnalogRead library to adjust the smoothing of the analog readings.
- Regarding the Sensor array, if PSX functionality is not desired, set the second values to PS_INPUT::PS_NONE.
- Push the code to the board
- For attaching a PSX cable, refer to veroxzik's PSX Library. Note that if powering via the 7.6v Rumble line, you will need to use a Schottky diode (side with line leading to Arduino VIN pin, other side to PSX cable).
- Open
Tools
>Serial Monitor
to open the Serial Monitor - Within the serial monitor, enter
t
to show current thresholds. - You can change a sensor threshold by entering numbers, where the first number is the sensor (0-indexed) followed by the threshold value. For example,
3 180
would set the 4th sensor to a threshold of 180. You can change these more easily in the UI later. - Enter
v
to get the current sensor values. - Putting pressure on an FSR, you should notice the values change if you enter
v
again while maintaining pressure.
- Install Python. On Linux you can install Python with your distribution's package manager. On some systems you might have to additionally install the python3 header files (usually called
python3-dev
or similar). - Install Node
- Install yarn. A quick way to do this is with NPM:
npm install -g yarn
- Install yarn. A quick way to do this is with NPM:
- Within server.py, edit the
SERIAL_PORT
constant to match the serial port shown in the Arduino IDE (e.g. it might look like"/dev/ttyACM0"
or"COM1"
)- You also may need to modify the
sensor_numbers
variable for the number of panels used.
- You also may need to modify the
- Edit this line in App.js according to number of sensors in panel. Note that you will need to run 'npm run build' within the webui folder for every change done (webserver can be kept running, just refresh page after building changes).
- Open a command prompt (or terminal) and navigate to
./webui/server
withcd webui/server
- Run
python -m venv venv
(you may need to replacepython
withpy
on Windows or potentiallypython3
on Linux) - Run
venv\Scripts\activate
(on Linux you runsource venv/bin/activate
) - Run
pip install -r requirements.txt
to install dependencies (might need to usepip3
instead ofpip
on Linux) - Then move to the
./webui
directory by doingcd ..
- Run
yarn install && yarn build && yarn start-api
- On Linux, you'll also need to edit the
start-api
script in./webui/package.json
to referencevenv/bin/python
instead ofvenv/Scripts/python
- On Linux, you'll also need to edit the
The UI should be up and running on http://localhost:5000 and you can use your device IP and the port to reach it from your phone (e.g. http://192.168.0.xxx:5000 )
- If you use localhost in your browser and if the UI looks choppy, try using your local IP instead
- If you see the following error, ensure the "Serial Monitor" isn't already open in Arduino IDE
serial.serialutil.SerialException: [Errno 16] could not open port /dev/cu.usbmodem83828101: [Errno 16] Resource busy: '/dev/cu.usbmodem83828101
- If you notice that your input is delayed and perhaps that delay increases over time, you can sometimes rectify that by restarting the server. Close your
start-api
window and run it again.
Create a new text file called start_fsrs.bat
and place it on your desktop.
start "" http://YOUR_PC_NAME_OR_IP:5000/
cd C:\Users\YourUser\path\to\fsr\webui
yarn start-api
Now you can just click on that file to open the UI and start the server.