pynq.lib.led Module

The pynq.lib.rgbled module is a driver for controlling onboard single-color Light Emitting Diodes (LEDs).

class pynq.lib.led.LED(index)[source]

Bases: object

This class controls the onboard LEDs.

index

int – The index of the onboard LED, starting from 0.

off()[source]

Turn off a single LED.

Returns:
Return type:None
on()[source]

Turn on a single LED.

Returns:
Return type:None
read()[source]

Retrieve the LED state.

Returns:Either 0 if the LED is off or 1 if the LED is on.
Return type:int
toggle()[source]

Flip the state of a single LED.

If the LED is on, it will be turned off. If the LED is off, it will be turned on.

Returns:
Return type:None
write(value)[source]

Set the LED state according to the input value.

Parameters:value (int) – This parameter can be either 0 (off) or 1 (on).
Raises:ValueError – If the value parameter is not 0 or 1.