
Print Fixed-Point Values Without printf Float Support
Print Q15 and Q16.16 numbers as decimals in C with integer arithmetic only: split, round, pad the fraction, carry, handle the sign, skip printf float code.
Bare-metal firmware on STM32, ESP32, RP2040, AVR, nRF and RISC-V: GPIO, UART, SPI, I2C, DMA, interrupts, timers, low power and over-the-air updates.

Print Q15 and Q16.16 numbers as decimals in C with integer arithmetic only: split, round, pad the fraction, carry, handle the sign, skip printf float code.

Convert floats to Q15 and back in C with rounding, saturation and NaN handling, build compile-time Q15 constants, and convert whole sample blocks safely.

Learn what Q15, Q31 and Q16.16 mean, how a stored integer maps to a real value, and how to compute the range and resolution of any Q format in C.

Compare the TinyGo -gc=conservative, -gc=leaking and -gc=none garbage collector settings, what each costs, and which one fits a given firmware.

Attach a handler to a pin edge with machine.Pin.SetInterrupt in TinyGo 0.37, keep the handler short with atomics, and debounce a button in the main loop.

Configure machine.I2C0 in TinyGo, scan the bus, read a chip ID register by hand, then read a BME280 with the tinygo.org/x/drivers package.

Install Alire, select the gnat_arm_elf toolchain, create a crate, add a board support crate and run alr build to produce an ARM Cortex-M firmware ELF.

Write a build.zig that targets thumb-freestanding for a Cortex-M4, add a linker script and vector table, and produce a flashable ELF and binary with Zig 0.14.

Install TinyGo 0.37, write a Go blinky for the Raspberry Pi Pico, put the board in BOOTSEL mode and flash it with tinygo flash -target=pico.

Port a driver from embedded-hal 0.2 to 1.0 with exact trait changes for I2C, SPI, GPIO and delays, plus the embedded-hal-compat bridge for mixed crates.

Build a TMP102 temperature driver generic over the embedded-hal 1.0 I2c trait, with typed errors, a release method and host unit tests using embedded-hal-mock.

Learn the layers of embedded Rust crates, from cortex-m and the PAC through the HAL to a board support crate, with one pin toggle written at each level.
We send one email when a new post is published. No spam.