NuMakerMar 29, 2019 Page 21 of 31 Rev 1.00NUMICROPY USER MANUAL1. from pyb import I2C2.3. i2c = I2C(1, I2C.MASTER) # create and initiate I2C1 as a master4. i2c.scan() # scan for slaves on the bus, returning a list of valid addresses.Only valid when in master mode.5. i2c.is_ready(0x42) # check if slave 0x42 is ready6. i2c.send('123', 0x42) # send 3 bytes to slave with address 0x427. data = bytearray(3) # create a buffer8. i2c.recv(data) # receive 3 bytes, writing them into data9. i2c.deinit() # turn off the peripheralI2C(bus, mode, [addr=-0x12, baudrate=100000, gencall=False]) mode must be either I2C.MASTER or I2C.SLAVE addr is the 7-bit address (only sensible for a slave) baudrate is the SCL clock rate (only sensible for a master) gencall is whether to support general call mode.RTC Class1. from pyb import RTC2.3. rtc = RTC()4. rtc.datetime((2017, 8, 23, 1, 12, 48, 0, 0)) # set a specific date and time5. rtc.datetime() # get date and timeUART ClassTable 5-5 is UART support list by the board.Board UART Pin Name Board Pin Name CPU Pin NameNuMaker_PFM_M487 UART1_RXD D0 B2UART1_TXD D1 B3UART1_CTS D12 A1UART1_RTS D11 A0UART5_RXD D9 A4UART5_TXD D8 A5UART5_CTS D0 B2UART5_RTS D1 B3Table 5-5 UART Support List1. from pyb import UART2.3. uart = UART(1, 9600, bits=8, parity=None, stop=1) # initiate UART14. uart.read(10) # read 10 characters, returns a bytes object5. uart.read() # read all available characters6. uart.readline() # read a line7. uart.readinto(buf) # read and store into the given buffer8. uart.write('abc') # write the 3 characters9. uart.readchar() # read 1 character and returns it as an integer10. uart.writechar(42) # write 1 character11. uart.any() # returns the number of characters waiting