Primary target is now the Pico W; functionality preserved on other boards. IR TX (RP2040/PWM): rewritten to a non-blocking, real-time symbol state machine. A hardware-PWM 56 kHz/40% carrier is gated by a one-shot k_timer (mark/space flips in the timer ISR), so TX never busy-waits and runs concurrently with IR RX, BLE and everything else. Queued frames (BLE "bomb") are sent back-to-back with a 50 ms inter-frame gap. Boards whose ir-tx is a plain GPIO keep the (blocking) software bit-bang carrier as a fallback. IR RX: cycle timestamps captured in the ISR, converted to us off the interrupt path in the decode work item (lower ISR jitter). Fixes: - Heartbeat moved off GPIO25 (CYW43 WL_CS on Pico W) to GPIO14 to avoid corrupting WiFi/BLE. - APP_BLE now selects BT_DEVICE_NAME_DYNAMIC (bt_set_name needs it). Optimizations: - RGB rewritten with integer math (no soft-float on the FPU-less M0+). - CONFIG_SIZE_OPTIMIZATIONS; 100 us tick so OLT symbol durations schedule exactly. Pico W: boards/rpi_pico_rp2040_w.conf enables BLE out of the box. Docs: resolved hardware TODOs (battery cell-count divider, PWM channel math, heartbeat, carrier), README primary target = Pico W, inline comments. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .claude | ||
| .vscode | ||
| docs | ||
| lib | ||
| zephyr_app | ||
| .gitignore | ||
| .micropico | ||
| CLAUDE.md | ||
| main.py | ||
| migration-prompt.md | ||
| README.md | ||
lasertag_remote_control
OpenLaserTag device, MicroPython
Raspberry Pi Pico W
MicroPython FW: https://micropython.org/download/RPI_PICO_W/
Pi Pico W datasheet https://datasheets.raspberrypi.com/picow/pico-w-datasheet.pdf
PCB 51x21mm, 1mm hole 20x8(10) 2.54 pitch grid
Pi Pico BLE: https://electrocredible.com/raspberry-pi-pico-w-bluetooth-ble-micropython/
Micropython IR: https://github.com/peterhinch/micropython_ir/blob/master/RECEIVER.md
Pi Pico VSCode: https://randomnerdtutorials.com/raspberry-pi-pico-vs-code-micropython/
STM32WB
MicroPython FW: https://micropython.org/download/?mcu=stm32wb
BLE Bluetooth UART - terminal
https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal
install OpenLaserTag on Pi Pico W
install primitives lib
$ mpremote mip install "github:peterhinch/micropython-async/v3/primitives"
install lib folder on device
$ mpremote connect /dev/ttyACM0 cp -r ./lib :
install main.py
$ mpremote connect /dev/ttyACM0 cp ./main.py :
OpenLaserTag remote box
Box Z62, 2xAA:
https://www.kradex.com.pl/product/enclosures_with_battery_basket/z62
https://www.krabicky-pro-elektroniku.cz/plastova-krabicka-z62--cerna/
BLE Bluetooth UART - terminal
https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal
Pi Pico
IR RX
IR RX TSOP4856
datasheet: https://www.vishay.com/docs/82459/tsop48.pdf
- pin1 OUT - Pi Pico pin 16 (pull up)
- pin2 VCC
- pin3 GND
IR TX
- IR TX TSAL6200 / TSAL6100
- PN2222A NPN transistor
- resistor 47R
Pi Pico pin:
- pin 16 - IR RX
- pin 17 - IR TX - 22R - IR LED OSRAM SFH4544
- pin 18 - button
- pin 19 - button
- pin 20 - button
- pin 22 - Red LED, resistor 75R
- pin 28 - 2xAA 1,5V BAT - Schottky diode - VSYS Pi Pico
- pin 15 - PN2222A NPN transistor - Piezo
BLE UART Serial Terminal
Show IR RX recived commands
Send IR Commands from terminal
led_offLED OFFled_onLED ONbombSend Explode command over IR TX- Any Lasertag command in hex
FFFFFFor0xFFFFFFsend this command over IR TX