def get_mode(index):
"""Returns the mode of a LED.
The LED must be initialised before calling this function.
index: must be an integer in range 0..7
Note: An exception is thrown if it fails to retrieve the mode of a LED.
"""
mode = ctypes.c_uint8(0)
ret = _LIB.led_get_mode(index, ctypes.byref(mode))
if ret < 0:
raise Exception("led get mode failed")
return mode.value
评论列表
文章目录