How to use the Canvas Mono class for monochrome displays
masterThe Canvas Mono class is designed for monochrome display chips (such as the SSD1306 or SH1106) that require an in-memory buffer of the graphics data to be transferred in bulk to the display hardware.
To use Canvas Mono correctly, you must initialize it so that its internal memory buffer matches the physical characteristics of the display chip. This includes:
- Dimensions: The width and height of the display memory.
- Byte Orientation: Whether a byte is oriented horizontally or vertically in the display memory.
Note on Rotation: When you change the orientation (rotation) of the canvas (e.g., to 90 or 270 degrees), the width and height of the logical display will swap, but the underlying memory organization remains unchanged. The class handles the positioning of graphics elements like lines or characters within the memory buffer based on this orientation.