From 1ff5a4b9ec18349aedecceaa4bd5fcac6832ff42 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Fri, 15 Jul 2022 17:30:37 -0400 Subject: [PATCH 1/1] Use fenced code in README so that copy/paste from GitHub includes line breaks --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 46e9939..cf832ab 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,13 @@ Setup Changes: - Make sure the top address is set correctly! Use this small program to scan for I2C devices: +```python import machine sda=machine.Pin(0) scl=machine.Pin(1) i2c=machine.I2C(0,sda=sda, scl=scl, freq=400000) print(i2c.scan()) +``` - Once you get an address through the console (REPL), this will be in decimal and not hex. You can convert the decimal to hex or simply put a decimal address in the setup. in my case, the decimal addr. was 39 which converts to 0x27 in hex. -- 2.47.3