Skip to content
The Infinnovation team edited this page Apr 29, 2016 · 3 revisions

The mbed module contains python equivalents of functions and classes in the mbed API.

Functions

wait_ms(ms)

Delay for the given number of milliseconds

wait_us(us)

Delay for the given number of microseconds

Classes

d = DigitalOut(pin)

A GPIO output pin

d.write(value)

Set the pin output (1 or 0)

value = d.read()

Read the value last written

b = d.is_connected()

d = DigitalIn(pin[, pinmode])

v = d.read()

d.mode(pinmode)

b = d.is_connected()

s = Serial(txpin, rxpin)

s.baud(baudrate)

s.format(bits, parity, stop_bits)

b = s.readable()

b = s.writeable()

s.send_break()

s.putc(char)

s.puts(string)

c = s.getc()