File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ Features supported at this time:
12
12
<
FBB7
/tr>13
13
* REPL (interactive prompt) over Zephyr UART console.
14
14
* ` utime ` module for time measurements and delays.
15
- * ` machine.I2C ` class for I2C control.
16
15
* ` machine.Pin ` class for GPIO control.
16
+ * ` machine.I2C ` class for I2C control.
17
17
* ` usocket ` module for networking (IPv4/IPv6).
18
18
* "Frozen modules" support to allow to bundle Python modules together
19
19
with firmware. Including complete applications, including with
@@ -82,20 +82,20 @@ To blink an LED:
82
82
LED.value(0)
83
83
time.sleep(0.5)
84
84
85
- To scan for I2C slaves:
86
-
87
- from machine import I2C
88
-
89
- i2c = I2C("I2C_0")
90
- i2c.scan()
91
-
92
85
The above code uses an LED location for a FRDM-K64F board (port B, pin 21;
93
86
following Zephyr conventions port are identified by "GPIO_x", where * x*
94
87
starts from 0). You will need to adjust it for another board (using board's
95
88
reference materials). To execute the above sample, copy it to clipboard, in
96
89
MicroPython REPL enter "paste mode" using Ctrl+E, paste clipboard, press
97
90
Ctrl+D to finish paste mode and start execution.
98
91
92
+ Example of using I2C to scan for I2C slaves:
93
+
94
+ from machine import I2C
95
+
96
+ i2c = I2C("I2C_0")
97
+ i2c.scan()
98
+
99
99
100
100
Minimal build
101
101
-------------
You can’t perform that action at this time.
0 commit comments