SerialSender¶
-
class
ledwall.components.
SerialSender
(port_name='/dev/ttyACM0', baudrate=500000)¶ -
init
(panel)¶ Sets the associated display. This method will be called by the display, so don’t call this method directly. When update() is called, the implementation can access the display via the property ‘panel’. (I know, it’s confusing and will be changed in the future).
-
update
()¶ Sends the data via the USB cable to the micro controller.
If gamma correction is enabled for the associated display each byte of the color data is mapped to the gamma corrected value.
The command value
Sender.CMD_PAINT_PANEL
may not be one of the data values to be transmitted, because for the arduino sketch this marks the beginning of a new frame. In gamma corrected color values this is always true, because the command value is not in the gamma8 mapping table.If gamma correction is disabled and the color data contains the command value, the data value is increased by one. For example the color value
(234, 5, 235)
is mapped to the color(235, 5, 235)
on the fly. The value in the display data is not changed.Tip
Please read the documentation for PySerial, as not every baudrate is supported on every plattform. Also there you will find the naming convention for the ports on different plattforms.
-