2026 remote: build for the Teensy 4.0 actually in the remote

Board teensy41 -> teensy40. All pins exist on the 4.0; the MPU6050's
Wire2 (SDA2 25 / SCL2 24) is on the underside solder pads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-11-14 12:19:16 +01:00
1 parent 769d72462d
commit e23216b3a1
7 files changed
+20 -18

No files matched your search

+5 -3
View File
@@ -2,7 +2,7 @@
#include <Arduino.h>
// =====================================================================
// Remote handset config (Teensy 4.1). Everything here is a placeholder
// Remote handset config (Teensy 4.0). Everything here is a placeholder
// until checked against your real wiring and parts - see the BENCH notes.
// Radio address/channel/rate/PA/payload size are NOT here: they live in
// shared/HexapodProtocol so they can't drift from the robot.
@@ -69,8 +69,10 @@ constexpr float STICK_EXPO[NUM_AXES] = { 0.25f, 0.25f, 0.30f, 0.20f, 0.20f,
// One-pole low-pass on raw ADC counts (1 = no filtering). Pots are noisy.
constexpr float STICK_FILTER_ALPHA = 0.5f;
// ---- Remote IMU: MPU6050 on the second I2C bus (Wire2: SDA2 = 25, SCL2 = 24) ----
// Not Wire (18/19): those pins are stick axes A4/A5.
// ---- Remote IMU: MPU6050 on the third I2C bus (Wire2: SDA2 = 25, SCL2 = 24) ----
// On the Teensy 4.0, 24/25 are solder pads on the underside, not edge pins.
// Not Wire (18/19): those pins are stick axes A4/A5. Not Wire1 (17/16) either:
// those are stick axes A3/A2.
#define IMU_WIRE Wire2
constexpr uint8_t IMU_ADDR = 0x68; // 0x69 if AD0 is pulled high
// Mounting remap: which chip axis (0=X,1=Y,2=Z) and sign gives each handset
+4 -4
View File
@@ -1,4 +1,4 @@
# Hexapod remote firmware (Teensy 4.1)
# Hexapod remote firmware (Teensy 4.0)
Handheld transmitter for the hexapod. It reads two 3-axis twist-grip
joysticks and an MPU6050, takes operator commands from a Nextion
@@ -13,17 +13,17 @@ From the `2026-current` folder: `pio run -e remote`, flash with
## Wiring (from the old remote sketch in `../../2019-teensy-nrf24/remote/`; edit `Config.h` if yours differs)
| Part | Signal | Teensy 4.1 pin |
| Part | Signal | Teensy 4.0 pin |
|------|--------|----------------|
| nRF24L01 | MOSI / MISO / SCK | 11 / 12 / 13 (SPI0) |
| nRF24L01 | CE / CSN | 9 / 10 |
| nRF24L01 | VCC | 3.3 V, with a 10–100 µF cap right at the module |
| MPU6050 | SDA / SCL | **25 / 24 (Wire2)**: not 18/19, those are stick pins A4/A5 |
| MPU6050 | SDA / SCL | **25 / 24 (Wire2)**, solder pads on the underside of the 4.0: not 18/19, those are stick pins A4/A5 |
| Nextion | TX → RX1, RX ← TX1 | 0 / 1 (Serial1), 5 V supply |
| Sticks | 6 axes | A0–A5. Which axis is on which pin isn't known yet: reorder `STICK_PINS` until the `p` dump reads right |
**MPU6050 rewiring:** the old remote had its MPU code switched off, probably
because A4/A5 double as Wire's pins. Move the MPU's SDA/SCL to pins 25/24.
because A4/A5 double as Wire's pins. Move the MPU's SDA/SCL to pins 25/24 (the pads under the board).
Stick pots are wired 3.3 V – wiper – GND. **Never feed 5 V into a Teensy
4.x analog pin.**
+1 -1
View File
@@ -7,7 +7,7 @@
#include "NextionUI.h"
#include "SerialConsole.h"
// Hexapod remote (Teensy 4.1): reads two 3-axis sticks and the handset
// Hexapod remote (Teensy 4.0): reads two 3-axis sticks and the handset
// MPU6050, takes operator commands from the Nextion touchscreen (and the USB
// serial console), and transmits a CmdPacket to the robot at TX_HZ.
// See README.md for wiring, calibration and the serial key map.