Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
ed7da03
Added Bypass Mode toggle to task list
May 11, 2025
c64862f
Added Midi support for setting the time stamp for timing parameters w…
May 12, 2025
3bc6cdf
Fixed parameter types for the TS parameters
May 12, 2025
cf9d2c8
Fixed issue where sending multiple Midi CC messages over bluetooth ch…
May 15, 2025
dcbdae5
Added 2 new build variants, for collaboration with Pirate Midi to sel…
May 16, 2025
ff83bd0
- Added landscape mode UI for 1.69"
May 17, 2025
9777967
Release of V1.0.10.2 beta 1.
May 17, 2025
cc852c5
Release of V1.0.10.2 beta 2:
May 18, 2025
2f74686
Added missing release file form 1.0.10.2 beta 2 for DevKitC N16R8
May 21, 2025
f279729
Added midi mapping task
May 23, 2025
f541f85
Release of V1.0.10.2 beta 3.
May 26, 2025
bdf30c3
Final release of V1.0.10.2. Same builds as beta 3.
Jun 2, 2025
6b94e89
Added UI design file for LilyGo T-Display S3 with 1.9" 170x320 LCD.
Jun 2, 2025
56e13c1
New Midi data processor, able to handle various cases of optional hea…
Jun 8, 2025
ce018ad
Added touch screen driver for Waveshare 1.69 Touch platform. Added le…
Jun 8, 2025
c11cb62
Fixed accidental commit of USB comms commented out. Updated preview b…
Jun 8, 2025
08d5b35
Development Checkpoint:
Jun 21, 2025
9f5f54b
- Added build config for Pirate Midi Polar Max (4.3B)
Jun 21, 2025
0805c39
Ported I2C API to newer version introduced in ESP IDF 5.2.
Jun 21, 2025
b84b46a
More work on ESP IDF 5.4 support.
Jun 22, 2025
822f15d
Fixed issue with unitialised string concatenation, thanks to user bak…
Jun 22, 2025
389151d
- Added build for Pirate Midi Polar Max
Jun 22, 2025
13b2da3
Update README.md
Builty Jun 28, 2025
95f08f3
Added preliminary support for Waveshare 1.9" board. Not tested yet, a…
Jul 1, 2025
6d31ad2
Create MidiCommands.md
Builty Jul 1, 2025
7e63b59
Update MidiCommands.md
Builty Jul 2, 2025
58bdd35
Fixed issue with display driver on Waveshare 1.9 (new platform)
Jul 2, 2025
63e7159
Merge branch 'main' of https://github.com/Builty/TonexOneController
Jul 2, 2025
e552be2
Start of support for big Tonex pedal. Incomplete and not fully functi…
Jul 5, 2025
57e3896
More work on Tonex Pedal support. Restructured web page to handle bot…
Jul 6, 2025
96df456
More work on Tonex Pedal comms
Jul 7, 2025
5cb35ee
More work on big Tonex support
Jul 8, 2025
8feb40d
Fixed issues with touch screen gesture preset change on Waveshare 1.9"
Jul 10, 2025
90b9247
Split display.c file to break out the hardware-specific platform init…
Jul 12, 2025
87e1439
Fixed issue with preset order bank boxes, broken during update to 150…
Jul 14, 2025
2eb2d72
Dev checkpoint. Added support for 0-based preset indexing for the big…
Jul 15, 2025
de865ce
Finalised support for 0-based preset indexing on the Tonex pedal.
Jul 15, 2025
e2d019a
- Split large preset name array into a separate struct, to help alloc…
Jul 15, 2025
08f257d
- Fixed issues with Waveshare 1." display driver config
Jul 16, 2025
b74bf06
- More work on effect icons on web page. Now showing the model.
Jul 16, 2025
a08b40e
Added new platform Waveshare ESP32-S3 3.5" Touch (not functional yet)
Jul 17, 2025
7d9026a
- fixed issue on big Tonex, when changing preset via its footswitch, …
Jul 17, 2025
cbdc0d1
Implemented effect icon re-ordering on web page.
Jul 17, 2025
055ed4f
New scheme for saving user preset description text. Instead of a big …
Jul 18, 2025
0a57168
More work on Waveshare 3.5" platform
Jul 19, 2025
44f5a6e
More work on Waveshare 3.5B support.
Jul 20, 2025
693a0ce
More work on ESP32-S3 3.5" board.
Jul 22, 2025
86f4b38
More work on Waveshare ESP32-S3 3.5"
Jul 22, 2025
a0da373
Added platform JC3248WS35C 3.5" touch.
Jul 22, 2025
9017242
Fixed issue with effect icon locations for 3.5" platforms.
Jul 23, 2025
ac595cc
More work on 3.5" display platforms. Still some bugs, especially on t…
Jul 23, 2025
b74aa1a
Added Waveshare 1.69 touch landscape build version, and added touch g…
Jul 23, 2025
ff3df21
Fixed issue with wrong I2C pin definition on JC32248W535
Jul 24, 2025
bf72475
- Fixed issues with JC3248W 3.5" platform LCD/touch freezing.
Jul 24, 2025
4d5d216
- Added ability to send midi value 64 to toggle any boolean parameter…
Jul 25, 2025
3b4ebda
- Fixed bug where migration of legacy config ended up with corrupted …
Jul 26, 2025
49f901c
- Implemented support for Global value request/modify on big Tonex pedal
Jul 26, 2025
ab13371
- Added support for Global volume adjustment. Sliders on 4.3B/3.5B/We…
Jul 28, 2025
970b3e2
Updated web config instructions for clarity
Jul 29, 2025
17b9251
- Fixed issues where if web config was loaded and then the controller…
Jul 30, 2025
e430dfc
Tweaks to mDNS init. Also updated the mDNS managed component to latest.
Jul 31, 2025
9a2c45a
* Changed web so that config is requested on first connect, but prese…
Aug 2, 2025
9ffc729
- updated build distrib script to include new platforms
Aug 4, 2025
022166f
- Added SDK config item for the flashing BPM indicator, and set it to…
Aug 4, 2025
6dfdd03
fix esp_idf_project_configuration.json values
nicola-lunghi Mar 22, 2025
c022811
ci: add ci to build with esp-idf default
nicola-lunghi Mar 22, 2025
c2ad3bb
footswitches: fix error shift count negative
nicola-lunghi Aug 6, 2025
35149aa
Merge pull request #249 from nicola-lunghi/fixup/shift
Builty Aug 9, 2025
f38d551
- fixed issue with web preset names not appearing on first connection
Aug 9, 2025
de4d4eb
Fixed issue with platforms that don't have a display, where they coul…
Aug 9, 2025
e2dde34
V2.0.0.2 beta 1 release (finally!) A lot of work went in to this one.
Aug 9, 2025
27f2094
Update WebConfiguration.md with QR code for WiFi connection
Builty Aug 10, 2025
a32a3e0
Split hardware platform details into separate pages. General updates.
Aug 16, 2025
05442a9
Update HardwarePlatforms.md
Builty Aug 16, 2025
b08d76b
Update HardwarePlatform_Waveshare4.3B.md
Builty Aug 16, 2025
a8ace6b
Update HardwarePlatform_WaveshareZero.md
Builty Aug 16, 2025
8b15a82
Update HardwarePlatform_Waveshare_1.69.md
Builty Aug 16, 2025
6e9d547
Update HardwarePlatform_DevKit-C.md
Builty Aug 16, 2025
f6479cf
Update HardwarePlatform_Atom_S3R.md
Builty Aug 16, 2025
26cf228
Added hardware platform details for 3 new platforms (incomplete)
Aug 16, 2025
e1ebd58
Update HardwarePlatforms.md
Builty Aug 16, 2025
ef3ae16
Update HardwarePlatform_Waveshare1.9.md
Builty Aug 16, 2025
02e063d
Update HardwarePlatform_Waveshare3.5B.md
Builty Aug 16, 2025
057867a
Update HardwarePlatform_JC3248W535.md
Builty Aug 16, 2025
fd28877
Update HardwarePlatform_Waveshare1.9.md
Builty Aug 16, 2025
daa64b5
Update HardwarePlatform_Waveshare3.5B.md
Builty Aug 16, 2025
5b6698d
Update HardwarePlatform_JC3248W535.md
Builty Aug 16, 2025
1eefcdc
Update HardwarePlatforms.md
Builty Aug 17, 2025
28a6da7
Update HardwarePlatform_Waveshare1.9.md
Builty Aug 17, 2025
4d6b857
Update HardwarePlatform_Waveshare3.5B.md
Builty Aug 17, 2025
b62adfd
Update HardwarePlatform_JC3248W535.md
Builty Aug 17, 2025
86a8207
Update HardwarePlatform_Waveshare4.3B.md
Builty Aug 17, 2025
3a6eb9c
Update README.md
Builty Aug 17, 2025
0e571ba
Fixed issue with web page parameter adjustment via text entry boxes n…
Aug 18, 2025
ef5f666
Merge branch 'main' of https://github.com/Builty/TonexOneController
Aug 18, 2025
373cf3c
Fixed issue with Tonex pedal not showing correct preset number for pr…
Aug 19, 2025
574f845
Update README.md
Builty Aug 20, 2025
5534588
Update FirmwareDevelopment.md
Builty Aug 20, 2025
1a9e5f6
Fixed power issue on Lilygo T-Display S3
Aug 23, 2025
b5d3301
Merge branch 'main' of https://github.com/Builty/TonexOneController
Aug 23, 2025
1c38a3e
Changed units lable of the Reverb time in web config from millisecond…
Aug 24, 2025
3b065f4
Update FirmwareDevelopment.md
Builty Aug 24, 2025
37fd5af
- Enabled Touch screen on Lilygo T-Display S3
Aug 25, 2025
3047533
Update HardwarePlatforms.md
Builty Aug 25, 2025
679f4ce
Update HardwarePlatform_Lilygo_TDisplay_S3.md
Builty Aug 25, 2025
894d9ec
Update HardwarePlatform_Lilygo_TDisplay_S3.md
Builty Aug 30, 2025
20ade08
Update README.md
Builty Aug 30, 2025
b078f46
- added config option to increase the touch screen sensitivity on the…
Aug 31, 2025
150615b
feat(midi-cc-ab-preset-selection): add MIDI CC 120/121 for independen…
lucastephann Sep 2, 2025
1711ba1
Fixed issue with Lilygo T-Display S3 touch co-ords (and hence broken …
Sep 3, 2025
2660402
Added "toast" popup dialog message when connected using station mode,…
Sep 4, 2025
79ada2c
Merge pull request #246 from nicola-lunghi/nicolal/add-gh-ci
Builty Sep 4, 2025
4077ced
Thanks to Nicola and Roberto, adaptions to match with pull request to…
Sep 4, 2025
339f292
Changed CI workflow to use ESP-IDF 5.4.1.
Sep 4, 2025
a1693a3
Release of V2.0.0.2 beta 2.
Sep 5, 2025
152770f
Merge branch 'main' into midi-cc-ab-preset-selection
lucastephann Sep 5, 2025
951b266
chore: undo changes to .gitignore
lucastephann Sep 5, 2025
e656472
Added Home tab to web interface, to be a starting page with some gene…
Sep 7, 2025
7357e39
feat: add thread-safe MIDI CC commands for independent A/B preset slo…
lucastephann Sep 8, 2025
3947048
Added support for setting global volume via Midi.
Sep 9, 2025
eaa810c
Merge branch 'main' into midi-cc-ab-preset-selection
Builty Sep 9, 2025
fe08081
Merge pull request #266 from lucastephann/midi-cc-ab-preset-selection
Builty Sep 9, 2025
4039e51
Update HardwarePlatform_JC3248W535.md
Builty Sep 14, 2025
c42eea3
Moved CST816S touch driver from Components, to use the newer version …
Sep 16, 2025
f46bfdb
- Added support for setting a specific preset via footswitch effect b…
Sep 18, 2025
2591164
Merge branch 'main' of https://github.com/Builty/TonexOneController
Sep 18, 2025
bce822b
Implemented CST328 touch driver for Lilygo T-Display S3, as used on o…
Sep 19, 2025
16e44c4
Release of V2.0.0.2 beta 3.
Sep 20, 2025
032b75e
Fixed a few more issues with the Lilygo T-Display S3 touch screen wit…
Sep 20, 2025
8f6521d
Added build for JC3248W with pedal skins.
Sep 24, 2025
703e54b
Fixed issue with screen rotation on JC3248W and WS3.5B.
Sep 26, 2025
231227c
Release of V2.0.0.2 beta 4.
Sep 26, 2025
14540b3
Update README.md
Builty Sep 26, 2025
4b17a40
Fixed issue with touch screen when display set to 180 degree rotation…
Sep 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
92 changes: 92 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: ESP-IDF Build

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: # Allows manual triggering from the Actions page

env:
JSON_CONFIG_FILE: "source/esp_idf_project_configuration.json"

jobs:
extract-config:
runs-on: ubuntu-latest
outputs:
platforms: ${{ steps.extract-platforms.outputs.platforms }}
steps:
- run: env | sort

- name: Checkout repository
uses: actions/checkout@v4
with:
sparse-checkout: |
${{ env.JSON_CONFIG_FILE }}
sparse-checkout-cone-mode: false

- run: find . -type f

- run: which jq && jq --version

- name: Extract the keys (platform names) from the JSON file
id: extract-platforms
run: echo "platforms=$(jq -c 'keys' ${{ env.JSON_CONFIG_FILE }})" | tee -a ${GITHUB_OUTPUT}

build:
name: Build ${{ matrix.platform }}
needs: extract-config
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform: ${{ fromJson(needs.extract-config.outputs.platforms) }}

steps:
- run: env | sort

- name: Checkout repository
uses: actions/checkout@v4
with:
clean: true
# submodules: 'recursive'
sparse-checkout: |
source/

- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ github.job }}-${{ matrix.platform }}
evict-old-files: 'job'

- run: find . -type f -and -not -path './.git/*' -not -path './.ccache/*'

- run: which jq && jq --version

- name: Set SDKCONFIG_DEFAULTS for ${{ matrix.platform }}
run: echo "SDKCONFIG_DEFAULTS=$(jq -r '.${{ matrix.platform }}.build.sdkconfigDefaults | join(";")' ${{ env.JSON_CONFIG_FILE }})" | tee -a ${GITHUB_ENV:?}

- run: env | sort

- name: esp-idf build
uses: espressif/esp-idf-ci-action@v1
with:
path: 'source'
esp_idf_version: v5.5.1 # optional, default is latest
target: esp32s3 # optional, default is esp32
extra_docker_args: "-v ./.ccache:/root/.ccache -e CCACHE_DIR=/root/.ccache -e SDKCONFIG_DEFAULTS"
command: "idf.py build"

- run: find ./source/build -type f

- run: ccache --print-stat

- uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.platform }}
path: |
source/build/**/*.bin
source/build/flasher_args.json
if-no-files-found: error
22 changes: 21 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# macOS folder attributes
.DS_Store

build_distrib/temp

# ignore SquareLine Studio files
ui_design/backup
ui_design/cache
ui_design/cache
ui_design/autosave
ui_design_0.85/backup
ui_design_0.85/cache
ui_design_0.85/autosave
ui_design_1.69/backup
ui_design_1.69/cache
ui_design_1.69/autosave
ui_design_1.69_land/backup
ui_design_1.69_land/cache
ui_design_1.69_land/autosave
ui_design_1.9/backup
ui_design_1.9/cache
ui_design_1.9/autosave
ui_design_480x320land/backup
ui_design_480x320land/cache
ui_design_480x320land/autosave


82 changes: 55 additions & 27 deletions FirmwareDevelopment.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Tonex One Controller: An open-source controller and display interface for the IK Multimedia Tonex One guitar pedal
This project uses a low-cost embedded controller (Espressif ESP32-S3) to form a bridge to the IK Multimedia Tonex One guitar pedal (which does not have native Midi capability.)
# Tonex Controller: An open-source controller and display interface for the IK Multimedia Tonex One and Tonex pedal
This project uses a low-cost embedded controller (Espressif ESP32-S3) to form a bridge to the IK Multimedia Tonex One guitar pedal (which does not have native Midi capability) and also the Tonex Pedal.

# Development Info
The code is written in C, for the Espressif ESP-IDF development environment version 5.0.2, and using the FreeRTOS operating system.
The code is written in C, for the Espressif ESP-IDF development environment version 5.4.1, and using the FreeRTOS operating system.
The LVGL library is used as the graphics engine.

## Task overview:
Expand All @@ -22,36 +22,64 @@ Building the application requires some skill and patience.
Use the Menu Config system to select which components of the Controller you wish to enable.
![image](https://github.com/user-attachments/assets/593d48fb-aeea-4b20-87c7-dc9212952213)

There are also a few settings that need changing between the Waveshare board with display and the Zero without a display, mainly due to the headless board having 4 MB flash versus 8MB on the display board:
### Partition Table
- Waveshare Zero: "partitions_zero.csv"
- All others: "partitions.csv"
- All platforms: "partitions.csv"

### SPI RAM config
Mode of SPI RAM chip in use:
- Display board: "Octal Mode PSRAM"
- No Display board: "Quad Mode PSRAM"
- "Octal Mode PSRAM"
- "Quad Mode PSRAM"

### Serial Flasher Config
Flash Spi Mode:
- Display board: "QIO" (Quad mode)
- No Display board: "DIO" (Dual mode)
- "QIO" (Quad mode)
- "DIO" (Dual mode)

### Flash Size:
- Display board: "8MB"
- No Display board: "4MB"

## Adding a new Platform
To add support for a new PCB platform, the following steps are required:
- Create sdkconfig.<boardname> in source folder, where <boardname> is a short descriptive name of the board. E.g. Waveshare 4.3B is "ws43B"
- In this file, referring to the existing examples, configure the partition table, CPU speed, flash mode, and SPIRAM. If the board has a display, create a new descriptive Config for it. E.g. CONFIG_TONEX_CONTROLLER_DISPLAY_WAVESHARE_800_480
- Edit the file "esp_idf_project_configuration.json" in the source folder. This file defines all supported platforms, and links a shot name to a build directory, and the sdkconfig file (created earlier)
- If the board does not have a display, you should now be able to select the board from VS Code, and build it
- If the board has a display, then more work is required, as follows
- Ceate a new folder in the TonexOneController folder, called "ui_design_<descriptivename> where descriptive name is something uniqiue about the LCD, possibly its size or resolution
- In this folder create a UI project using Squareline Studio, and design the UI. Refer to the other ui designs, and try to match the names of the screens and components as much as possible (this will minimise other code changes)
- Set the Squareline Studio to export its files into "source/main/ui_generated_<descriptivename>"
- Edit the file "source/main/CMakeLists.txt" and enter the unique Config you created before, and use that to set the include directory to the new ui_generated folder, and add the source files from it
- Edit display.c to add your new Config, and inside that define, perform the display initialisation
- Update the function update_ui_element() to handle the events needed. These events are sent from other parts of the system, for things like enabling/disabling Bluetooth status icon, setting the name of the preset etc

- "8MB"
- "4MB"

# Wireshark USB Capture
- Download and install the latest version of the free app "Wireshark" from https://www.wireshark.org/
- Install it, ensuring the option for USB Pcap is enabled
- Start the Wireshark app
- Connect Tonex pedal to the same PC
- In the Wireshark app, select the Capture interface to USBPcap
<br>
<img width="478" height="339" alt="image" src="https://github.com/user-attachments/assets/4e0f1296-274d-43be-b683-e0cf6bed2085" />
<br><br>
- Press the blue Sharkfin button to begin capturing all USB packets
<br><br>
<img width="438" height="168" alt="image" src="https://github.com/user-attachments/assets/ecbc74c8-8e70-47b5-8516-20a8735f9ed4" />
<br><br>
- Start the Tonex Editor software, and let it complete its sync process<br>
- Press the red square button to stop capturing
<br><br>
<img width="753" height="348" alt="image" src="https://github.com/user-attachments/assets/75d66535-9cc0-48ba-8882-079bdd4fdfb8" />
<br><br>
- Use File -> Save As to save the captured data to disk

# Debug Logs
Extensive debug logging is used, in the form of serial printing from the main ESP32-S3 "UART" transmitter pin. To view these logs:
- Obtain a USB serial adaptor, compatible with 3.3 volt TTL signals (low-cost example shown below)<br>
<img width="1327" height="471" alt="image" src="https://github.com/user-attachments/assets/56b48788-f70c-4ccb-bbb5-fcd5f17531af" /><br>
- Connect the ground pin on the adaptor to a ground pin of the ESP32-S3
- Connect the "RX" pin of the adaptor to TX pin of the ESP32-S3 board (pin locations shown for some platforms below.)
<img width="480" height="308" alt="image" src="https://github.com/user-attachments/assets/7d6a7042-3ece-49e1-ba63-ebefd16ab469" /><br>
<img width="868" height="539" alt="image" src="https://github.com/user-attachments/assets/4118ab86-c613-409a-8d8a-892eb4f12f29" /><br>
<img width="909" height="600" alt="image" src="https://github.com/user-attachments/assets/5403c46d-c7d3-403c-9292-dfbce8568eea" /><br>
<img width="991" height="368" alt="image" src="https://github.com/user-attachments/assets/dd7bcfcb-674a-4d42-b57f-afc069fc3c9f" /><br>
- Download and install the latest version of the free app "Tera Term" from https://github.com/TeraTermProject/teraterm/releases (or use any other serial terminal program)
- Connect the USB serial adaptor to your computer, and let it load any drivers it needs
- Run Tera Term, and select the option for "Serial" and select the comm port corresponding to the USB serial adaptor
<img width="771" height="448" alt="image" src="https://github.com/user-attachments/assets/7c8d4260-68c8-49a5-8e6e-d28ddb29dd8a" /><br>
- Select "Setup" -> "Serial Port", and change the baud rate to 115200<br>
<img width="406" height="324" alt="image" src="https://github.com/user-attachments/assets/45954e1a-027f-4476-af3e-5313747f34e0" /><br>
- Power on the Controller board. Logging should appear on the Tera Term screen
- To log the data to disk, select File -> Log






104 changes: 104 additions & 0 deletions HardwarePlatform_Atom_S3R.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Tonex One Controller: An open-source controller and display interface for the IK Multimedia Tonex One guitar pedal
# M5Stack Atom S3R
# Table of Contents
1. [Connections](#connections)
2. [Wired Footswitches - onboard](#footswitches)
3. [Wired Footswitches - external](#footswitches_ext)
4. [Wired Midi](#midi)
5. [9 volt Power for 5 volt models](#9v_power)

This hardware platform uses the M5Stack Atom S3R board (8MB flash, 8 MB PSRAM version.)
<br>
https://shop.m5stack.com/products/atoms3r-dev-kit
<br><br>
<img width="320" height="323" alt="image" src="https://github.com/user-attachments/assets/b02bb831-21ab-4c67-9550-0e0bcce15e7c" />
<br><br>
This module is low cost, supports a tiny LCD display, and comes in a case. It requires a 5 volt DC power supply.
Caution: do not directly connect a pedalboard 9v! If you do, you will probably blow up both the PCB and your Tonex One!<br>
If you do wish to use 9v power, refer to [9 volt Power for 5 volt models](#9v_power)

## Connections <a name="connections"></a>
Note: the controller code relies on the Tonex One pedal being set to Stomp mode. Code is in place to do this automatically.
- Connect a DC jack to the PCB via the 4 pin connector, as shown below. Note the positive and negative polarity must match your power supply
- Connect the OTG USB-C port on the board to the ToneX One USB-C port
- Connect 5 volts DC to the power input jack that you connected in the first step
- Switch on the power supply
- The board USB port will power the Tonex One
- Optional: for the Bluetooth Client version of code, switch on a M-Vave Chocolate Midi pedal (https://www.cuvave.com/productinfo/724103.html). After a few seconds it should connect and the Bluetooth icon should change from gray to blue
- Optional: for the Bluetooth Server version of code, the controller will be available as a peripheral for you to connect to via a Bluetooth Midi device. The Bluetooth icon should change from gray to blue when connected.
![wiring_atom_s3r](https://github.com/user-attachments/assets/0829c254-23bb-4ef6-8695-c5a8d363d817)

<br><br>
## Wired Footswitches (onboard) <a name="footswitches"></a>
Wired footswitches can optionally be used. These "onboard" switches connect directly to the controller with out needing any additional circuitry.<br>
The footswitch must be a "momentary" type that is only has its contacts closed when it is pressed.
The common pin of the footswitch must connect to the Controller ground pin, and the other wires connected as shown.
<br><br>
A maximum of 4 footswitches are supported.
<br>
Various modes are supported, set using the web configuration:
- 2 switches, doing Next/Previous preset
- 4 switches, doing banked switching (just like the M-vave Chocolate pedal does)
- 4 switches, doing direct preset selection via binary (intended for relay control)<br>

![footswitches_atoms3r](https://github.com/user-attachments/assets/e3c227f4-f3ba-480b-a41d-3ab54e3966d5)

<br><br>
## Wired Footswitches (external) <a name="footswitches_ext"></a>
Starting from firmware version 1.0.8.2, with the use of an additional PCB, up to 16 footswitches can be connected.<br>
The footswitch must be a "momentary" type that is only has its contacts closed when it is pressed.
<br><br>
The additional PCB must use the "SX1509" chip. The recommeded one is the Sparkfun SX1509 breakout board:
https://www.sparkfun.com/sparkfun-16-output-i-o-expander-breakout-sx1509.html
<br>
![image](https://github.com/user-attachments/assets/0575f0a0-1eb3-4aef-a7e2-c321876f7ed0)

NOTE: other types of IO expander boards that use different chips are not supported and will not function. It must contain the SX1509 chip.

### Address Setting
The SX1509 PCB has a selectable address system. This must be set correctly in order for the board to function with the controller.
- Using a sharp knife, carefully cut the thin tracks between the pads as shown below
- Use solder to bridge the pads as shown below
- This sets the SX1509 adress to "11" which avoids conflicting with other parts on the controller boards
![sx1509_address](https://github.com/user-attachments/assets/84030e88-f6e7-4fc0-8230-3fff6dc1235a)


The common pin of each footswitch must connect to the SX1509 ground pins. The labels "0", "1" etc are the individual switch inputs. Footswitch 1 connected to input 0. Footswitch 2 to input 1 etc.
<br><br>
Multiple modes are supported, configured using the web configuration.
![external_atom_3sr](https://github.com/user-attachments/assets/2c5db1a0-b66a-4516-96fd-47d03f7526da)


## Wired Midi (firmware version V1.0.4.1 or above required) <a name="midi"></a>
Note: Wired Midi is disabled by default. If it is enabled without the proper hardware (detailed below) being fitted, you may get "phantom" preset changes, due to the serial input "floating".
Only enable wired Midi when hardware is connected!<br>
Refer here for details on how to enable it, and set the Midi channel:
https://github.com/Builty/TonexOneController/blob/main/WebConfiguration.md
<br><br>
Wired Midi is supported on all platforms. A extra PCB is required for all platforms, an "Adafruit Midi FeatherWing kit", for US$7.<br>
https://www.adafruit.com/product/4740 <br>
This Midi board supports both 5-pin DIN sockets (included in kit) and 3.5mm jacks (not included in kit.)<br>
<br>
Midi Featherwing:<br>
![midi_featherwing](https://github.com/user-attachments/assets/532d7d81-ae7e-485b-8d59-77ff6056e331)

M5Stack Atom S3R to Midi Featherwing:<br>
![midi_atoms3r](https://github.com/user-attachments/assets/1663b487-5ce2-44ac-8cf8-6fb71c7622a3)
<br><br>
## 9 volt Power for 5 volt Models<a name="9v_power"></a>
The Atom-S3R board has a maximum of 5 volts input.
<br>It is still possible however to run it from a 9 volt power supply, with the additional of another low cost off-the-shelf PCB.
<br>**Caution:** This section requires some more advanced skills, such as using a multimeter to measure voltage. Incorrect voltage setting or polarity could cause damage to the PCB and/or your Tonex pedal.
<br><br>Various electronic shops, and also suppliers like Amazon, often have low cost "switching regulators." These are a compact circuit that can convert the 9 volt pedalboard power down to the 5 volts required by the Zero and the 1.69. Sample photos are shown below.<br>
Some of these may be a fixed voltage, in which case you must select one with a 5 volt output. Most models however are adjustable, using a small "trimpot."
<br>For the adjustable types, it is necessary to set it to 5 volts output **before** connecting to the controller PCB.
<br>
- Connect the 9 volt input to the input terminals on the voltage regulator PCB. Ensure the positive and negative the right way around. The standard for pedal boards is usually negative to the centre pin of the DC jack, but this should be checked
- Set the multimeter to measure DC voltage, then connect the multimeter probes to the voltage regulator output terminals
- Adjust the trimpot on the voltage regulator PCB to achieve close to 5 volts. I doesn't have to be exactly 5 volts, but should be in the range of 4.95v to 5.05v
- Once this has been achieved, connect the voltage regulator output terminals to the board, in the same locations as shown in the prior wiring diagram
- Keep the Tonex pedal disconnected, and power on the board. Check that it boots up and runs normally
- Once this test has passed, then you can connect the Tonex pedal
![image](https://github.com/user-attachments/assets/e59673c5-f741-4516-b471-5af0eb685d12)
![image](https://github.com/user-attachments/assets/472394d5-a2c9-492d-909c-792480abcb4c)

Loading