pimoroni/piglow — pull request #2 by Gagravarr (2013-08-14 13:12:35+00:00)
Title: Auto-detect what I2C bus to use based on the Revision

If you try to run the piglow-example on an older (revision 1) Pi, you'll get a somewhat cryptic and unhelpful error message:
```
Traceback (most recent call last):
File "piglow-example.py", line 52, in
piglow = PiGlow(1)
File "piglow-example.py", line 24, in __init__
self.write_i2c(CMD_ENABLE_OUTPUT, 0x01)
File "piglow-example.py", line 43, in write_i2c
self.bus.write_i2c_block_data(self.i2c_addr, reg_addr, value)
IOError: [Errno 5] Input/output error
```
The code has a comment about needing to use a different bus for the older Pi models, but it would be a better quickstart example if the code detected and picked for you!