adafruit industries's banner
adafruit industries's profile picture

adafruit industries

@adafruit241,032 subscribers

Brooklyn, NY USA - Manufacturer, open-source hardware, certified Minority and Woman-owned Business Enterprise (M/WBE) X account managed by @ladyada & @ptorrone

Shorts

Will be releasing more about this project later! Talking 3D printed Python-powered talking D20 gaming dye 🐍🎲🗣️

Will be releasing more about this project later! Talking 3D printed Python-powered talking D20 gaming dye 🐍🎲🗣️

33,127 views

Videos

adafruit's profile picture

OpenClaw vs. a 475-page datasheet: let the robot do the transcribing 🦞🤖 The u-blox SAM-M8Q has been sitting on my bench for months. This little GPS module has a built-in antenna, coin cell backup, speaks both NMEA and UBX binary protocol over UART or I2C. So why isn't it in the shop already? Well, it's mostly cause of the 475-page interfacing datasheet documenting every command, struct, and config register. Hundreds of message types. I got partway through by hand with some Claude Code Sonnet assistance, but ran out of time - plus it was still tedious when babysitting Sonnet. However, now we're living in an Opus + Codex era! So I pointed my Raspberry Pi OpenClaw at it. Here's the setup: Raspberry Pi 5 running OpenClaw, wired to a QT Py RP2040, which talks to the SAM-M8Q. Opus 4.6 reads the datasheet (converted to markdown first by Sonnet 4.6 with 1M context to minimize re-parsing that PDF every session) and builds the implementation plan. I review the plan to make sure it prioritizes the most common commands and reports, and flagged some unessential sections like automotive-assist or RTK-specific. Then Codex is assigned each message implementation task as a sub-agent and writes the actual C code for the Arduino library. Opus suggested using struct-based parsing rather than digging through each uint8_t array; we just memcpy the checksummed message raw bytes onto the matching struct and extract the typed bit fields. We've got four message types done so far. After each message is implemented, Codex also writes a test sketch that will exercise / pretty-print the results of each message, great for self-testing as well as regression testing later. Tonight I'm telling it to keep going while I sleep: code, parse, test against live satellite data, fix failures, commit and push on success, then move on to the next. To me this is a great usage of "agentic" firmware development: there's no creativity in transcribing 84 different structs from a 475-page datasheet. Once the LLMs are done, I can review the PRs as if it were an everyday contributor and even make revision suggestions.

adafruit industries

60,039 views • 3 months ago

adafruit's profile picture

Full-circle Test-driven Firmware Development with OpenClaw Ladyada: "I've only had OpenClaw installed on this Raspberry Pi 5 for a couple of days, but boy, have we burned through a lot of tokens and learned a lot. Including what I think is a really fun improvement in my development process: “Agentic test-driven firmware development.” I've used LLMs for writing code as a sort of pair-programming setup, where I dictate exactly what I want done. But this is the first time that I'm giving full access to the hardware to the LLMs and letting Claude Opus 4.5 as a manager to control Codex subagents. Not only does it parse the datasheet for the register map and functionality, Claude also comes up with a full development and test plan, writes the library, tests it on existing hardware, and then also works up a test suite that covers all of the hardware registers to make sure that the library is exercising the entire chip capability. For example, here I give it an APDS-9999 color sensor and a Neopixel ring and tell it, “hey use the Neopixel ring to verify that we're really reading red, green, and blue data properly from the sensor,” and it will do the whole thing completely autonomously… no humans involved! I still review the final code and ensure the tests genuinely validate the functionality, not just take shortcuts. There is a phenomenon known as "reward hacking" (also called "specification gaming"). The model may optimize for passing tests as a metric, rather than ensuring the code truly works as intended. So far, the results have been excellent... no surprise, since these LLMs are trained on Adafruit open-source GitHub repositories!"

adafruit industries

25,105 views • 3 months ago

No more content to load