pyflipdot API¶
HanoverController¶
The HanoverController is the main class used for controlling flipdot signs.
-
class
pyflipdot.pyflipdot.
HanoverController
(port: serial.serialposix.Serial)[source]¶ Bases:
object
A controller for addressing Hanover signs
-
add_sign
(name: str, sign: pyflipdot.sign.HanoverSign)[source]¶ Adds a sign for the controller to communicate with
- Parameters
sign (HanoverSign) – Sign to add
- Raises
ValueError – Sign with same name already added
-
draw_image
(image_data: numpy.array, sign_name: str = None)[source]¶ Sends an image to a sign to be displayed
- Parameters
image_data (np.array) – Image to display
sign_name (str, optional) – Sign to address
- Raises
ValueError – Ambiguity which sign is to be addressed
-
property
signs
¶ Get the connected signs
- Returns
Signs, indexed by name
- Return type
Dict[str, HanoverSign]
-
HanoverSign¶
The HanoverSign class defines the specific signs connected to your controller, allowing them to be individually addressed.
-
class
pyflipdot.sign.
HanoverSign
(address: int, width: int, height: int, flip: bool = False)[source]¶ Bases:
object
A Hanover sign
-
address
¶ Address of the sign
- Type
int
-
flip
¶ True if the sign is upside-down
- Type
bool
-
height
¶ Pixel height of the sign
- Type
int
-
width
¶ Pixel width of the sidn
- Type
int
-