Skip to content
Snippets Groups Projects
Commit 834cf1cb authored by Andreas Gattringer's avatar Andreas Gattringer
Browse files

updated umnp-rhtp.py

parent 7376b361
No related branches found
No related tags found
No related merge requests found
......@@ -25,8 +25,8 @@ SPI_MISO = machine.Pin(16)
SPI_SCK = machine.Pin(18) # serial clock
# I2C PARAMETERS
I2C_SCL = machine.Pin(4) # serial clock
I2C_SDA = machine.Pin(5) # serial data
I2C_SCL = machine.Pin(5) # serial clock
I2C_SDA = machine.Pin(4) # serial data
# ETHERNET PARAMETERS
ETH_CS = machine.Pin(17) # chip select
......@@ -63,13 +63,12 @@ async def main():
# configure network
device = MeasurementDevice(device_type=DEVICE_TYPE_RHTP)
spi = device.add_spi(0, SPI_BAUD, mosi=SPI_MOSI, miso=SPI_MISO, sck=SPI_SCK)
i2c = device.add_i2c(i2c_id=1, scl=I2C_SCL, sda=I2C_SDA, timeout=10000)
i2c = device.add_i2c(i2c_id=0, scl=I2C_SCL, sda=I2C_SDA, timeout=10000)
dev_mac = device.generated_mac_raw()
ether = EthernetW5500(spi, ETH_CS, ETH_RST, dev_mac, ETH_USE_DHCP)
ether.set_network(ETH_IP, ETH_SUBNET, ETH_GATEWAY, ETH_DNS)
device.add_network_adapter(ether)
device.add_i2c(i2c)
comm = device.create_communicator()
sht45 = SHT45(i2c)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment