/** * WijiBoard – Home Section * web/js/sections/home.js * * A minimal placeholder home section. */ import BLE from '../ble.js'; const HomeSection = { _cleanup: [], mount(container) { container.innerHTML = `

WijiBoard

WiFi Spirit Board — SCARA arm controller. Select a section from the sidebar to get started.

Connection
BLE ${BLE.isConnected() ? `✓ ${BLE.getDeviceName()}` : 'Not connected'}

Use the Connect button in the top bar to pair with the WijiBoard via Bluetooth. The device name is WijiBoard.

About

This dashboard controls a two-arm SCARA robot that moves a planchette across a spirit board. It uses Web Bluetooth to communicate with an ESP32-C3 running two 28BYJ-48 stepper motors with AccelStepper.

Sections
`; // Keep home BLE status label in sync const statusEl = container.querySelector('#home-ble-status'); const update = () => { if (statusEl) statusEl.textContent = BLE.isConnected() ? `✓ ${BLE.getDeviceName()}` : 'Not connected'; }; BLE.on('connected', update); BLE.on('disconnected', update); this._cleanup = [ () => BLE.off('connected', update), () => BLE.off('disconnected', update), ]; }, unmount() { this._cleanup.forEach(fn => fn()); this._cleanup = []; }, }; export default HomeSection;