I2C bus¶. Hardware I2C is available on the X and Y halves of the pyboard via I2C('X') and I2C('Y').Alternatively pass in the integer identifier of the peripheral, eg I2C(1).Software I2C is also available by explicitly specifying the scl and sda pins instead of the bus name. For more details see machine.I2C.
pyb.udelay(us) ¶. Delay for the given number of microseconds. pyb.millis() ¶. Returns the number of milliseconds since the board was last reset. The result is always a micropython smallint (31-bit signed number), so after 2^30 milliseconds (about 12.4 days) this will start to return negative numbers. pyb.micros() ¶.
pyb.usb_mode('CDC+HID') # act as a serial device and a mouse. If you already changed your boot.py file, then the minimum code it needs to work is: import pyb pyb.usb_mode('CDC+HID') This tells the pyboard to configure itself as a CDC (serial) and HID (human interface device, in our case a mouse) USB device when it boots up. …
pyb.repl_uart (uart) ¶ Get or set the UART object where the REPL is repeated on. pyb.rng ¶ Return a 30-bit hardware generated random number. pyb.sync ¶ Sync all file systems. pyb.unique_id ¶ Returns a string of 12 bytes (96 bits), which is the unique ID of the MCU. pyb.usb_mode ([modestr, ] vid=0xf055, pid=0x9801, hid=pyb.hid_mouse) ¶
pyb.udelay(us) ¶. Delay for the given number of microseconds. pyb.millis() ¶. Returns the number of milliseconds since the board was last reset. The result is always a MicroPython smallint (31-bit signed number), so after 2^30 milliseconds (about 12.4 days) this will start to return negative numbers.