Commit 27f08625 authored by Damien George's avatar Damien George
Browse files

docs/wipy/quickref: Update reference for change to I2C API.

parent 8f205c2c
...@@ -112,7 +112,7 @@ See :ref:`machine.I2C <machine.I2C>`. :: ...@@ -112,7 +112,7 @@ See :ref:`machine.I2C <machine.I2C>`. ::
from machine import I2C from machine import I2C
# configure the I2C bus # configure the I2C bus
i2c = I2C(0, I2C.MASTER, baudrate=100000) i2c = I2C(baudrate=100000)
i2c.scan() # returns list of slave addresses i2c.scan() # returns list of slave addresses
i2c.writeto(0x42, 'hello') # send 5 bytes to slave with address 0x42 i2c.writeto(0x42, 'hello') # send 5 bytes to slave with address 0x42
i2c.readfrom(0x42, 5) # receive 5 bytes from slave i2c.readfrom(0x42, 5) # receive 5 bytes from slave
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment