mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
* Filled in all the board control examples. Everything works except for DAC. * Moved test drawing scripts to drawing dir and renamed them and added comments. * Filled in all the image filter stuff. There are still some tests that can be renamed, commented, and added to this folder. But, I will do that later. * Fixed motion detection thresholds. * Fixed LCD script comments. * Fixed BLE return value.
20 lines
606 B
Python
20 lines
606 B
Python
# I2C Control
|
|
#
|
|
# This example shows how to use the i2c bus on your OpenMV Cam by dumping the
|
|
# contents on a standard EEPROM. To run this example either connect the
|
|
# Thermopile Shield to your OpenMV Cam or an I2C EEPROM to your OpenMV Cam.
|
|
|
|
from pyb import I2C
|
|
|
|
i2c = I2C(2, I2C.MASTER) # The i2c bus must always be 2.
|
|
mem = i2c.mem_read(256, 0x50, 0) # The eeprom slave address is 0x50.
|
|
|
|
print("\n[")
|
|
for i in range(16):
|
|
print("\t[", end='')
|
|
for j in range(16):
|
|
print("%03d" % mem[(i*16)+j], end='')
|
|
if j != 15: print(", ", end='')
|
|
print("]," if i != 15 else "]")
|
|
print("]")
|