# Esp32 - Testing I2C bus presence and demonstrating
#    side effects on shared addresses
# provided by Anthony Vogelaar, Perth Scotland
# rev 0.10  2025-05-30  initial release

from	fks_drivers_01	import	lprint, i2c

# ===================== Tests =========================

# test lcd presence on I2C bus, see address 39 = 0x27
# test led's, see addresses [36, 37, 38, 39, 52, 53, 54, 55] 
def test1():
    addr = i2c.scan()
    print('used I2C addresses:', addr)
    
    
# Print Hello world to LCD 1602 @ 5V Vdd
def test2():
    lprint('Hello')
    lprint('   world!')
    
 
def test3():
        i2c.writeto(36, b'\x31')		# 0x24
        i2c.writeto(52, b'\x01')		# 0x34
        i2c.writeto(53, b'\x02')
        i2c.writeto(54, b'\x04')
        i2c.writeto(55, b'\xFF')
#        test2()						# side effect: DP's on led display


test3()

# ===================== End =========================
