Skip to content

feat: add typed BH1750 read tool#44

Open
tnm wants to merge 1 commit into
mainfrom
feat/bh1750-read
Open

feat: add typed BH1750 read tool#44
tnm wants to merge 1 commit into
mainfrom
feat/bh1750-read

Conversation

@tnm
Copy link
Copy Markdown
Owner

@tnm tnm commented Mar 23, 2026

Summary

  • add a first-class bh1750_read built-in tool for typed ambient light reads over I2C
  • extend host I2C mocks/tests to cover BH1750 success and failure paths, including distinct measurement-start failure coverage
  • update user-facing docs and the provider harness so BH1750 shows up wherever supported tools are listed

Details

  • bh1750_read accepts sda_pin, scl_pin, optional address, and optional frequency_hz
  • it defaults to address 0x23 and also supports 0x5C
  • runtime flow is deterministic in firmware: power on, start one-time high-resolution measurement, wait 180 ms, read 2 bytes, format lux
  • raw i2c_* tools stay in place; this is the first typed read layer on top

Validation

  • ./scripts/test.sh host
  • ./scripts/build.sh
  • flashed feat/bh1750-read onto the attached board and confirmed post-flash serial status smoke still works

Caveat

  • I do not have a convincing positive hardware BH1750 read on the attached board. This branch has strong host coverage plus generic board smoke, but not a real BH1750-on-hardware proof on the currently attached setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant