i2c_playground.py 299 B

12345678910111213
  1. from robot_control.src.api.i2c_handler import I2C
  2. from time import sleep
  3. # Initialize with multiple channels (1 through 4)
  4. i2c = I2C([3, 4])
  5. i2c.initialize()
  6. while(1):
  7. sleep(1)
  8. readings = i2c.read()
  9. for channel, value in readings.items():
  10. print(f"Channel {channel}: {value}")