The procedure is different for ESP8266 and ESP32 platforms.
I☬ and HW SPI based displays with support in u8g2 can be enabled. Visit the u8g2 homepage for technical details. Refer to graphics_a to get an impression how this is achieved with Lua code. This object provides all of u8g2's methods to control the display.
#St7920 code example how to#
The communication interface has to be initialized up front, refer to the examples below on how to do this.ĭisp = u8g2.ssd1306_i2c_128圆4_noname(id, sla)ĭisp = u8g2.ssd1306_128圆4_noname(bus, cs, dc, res) Based on the u8g2 class, you create an object for your display type. The Lua bindings for this library closely follow u8g2's object oriented C++ API.
#St7920 code example full#
This integration uses full "RAM" memory buffer without picture loop and calls u8g2's begin() internally when creating a display object. The NodeMCU firmware supports the following displays in I☬ and SPI mode: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)ĪRISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IFĪDVISED OF THE POSSIBILITY OF SUCH DAMAGE. LOSS OF USE, DATA, OR PROFITS OR BUSINESS INTERRUPTION) HOWEVERĬAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
IN NO EVENT SHALL THE COPYRIGHT HOLDER ORĬONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREĭISCLAIMED. INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#St7920 code example software#
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ANDĬONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, Materials provided with the distribution. List of conditions and the following disclaimer in the documentation and/or other Redistributions in binary form must reproduce the above copyright notice, this Of conditions and the following disclaimer. Redistributions of source code must retain the above copyright notice, this list Redistribution and use in source and binary forms, with or without modification,Īre permitted provided that the following conditions are met: