powerpods/goTool/cmd_accel.go
simon ba20544762 Add UART ACCEL_READ command for on-demand BMA456 samples.
Expose MessageType 24 with protobuf response (success, x, y, z in raw LSB),
firmware handler with mutex-safe I2C read, goTool `accel` CLI, and docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-28 19:55:02 +02:00

18 lines
315 B
Go

package main
import (
"fmt"
)
func runAccel(sp *serialPort) error {
r, err := sp.readAccel()
if err != nil {
return err
}
if !r.GetSuccess() {
return fmt.Errorf("accel read failed (sensor not ready?)")
}
fmt.Printf("accel: x=%d y=%d z=%d (raw LSB, ±2g)\n", r.GetX(), r.GetY(), r.GetZ())
return nil
}