I2C Address Scanner Simulation

Easy Python Interfacing Asked at Broadcom
Solve this problem

Simulate an I2C bus scan: probe every valid 7-bit address, record which ones acknowledge, and format the result as the familiar address grid.

Constraints

  • Valid 7-bit addresses are 0x08 to 0x77; reserved ranges must be skipped.
  • Use the provided probe(address) hook that returns True on ACK.
  • Return a sorted list of responding addresses.
  • Also return a formatted 16-column grid string.
  • No hardware access.
Starter codePython
1def scan_bus(probe):2    # TODO3    return {}