物联网开发笔记(58)- 使用Micropython开发ESP32开发板之控制2.90寸电子墨水屏模块

news2024/11/20 12:26:27

一、目的

        这一节我们学习如何使用我们的ESP32开发板来控制2.90寸电子墨水屏模块。

二、环境

        ESP32 + 2.90寸 电子墨水屏模块 + Thonny IDE + 几根杜邦线

接线方法:

 三、墨水屏驱动

        此处注意注意:不同的型号、不同厂家的墨水屏驱动方式有些不同,一定要联系卖家。

这里分享一下墨水屏驱动。1、老版本墨水屏驱动:

"""
MicroPython Waveshare 4.2" Black/White GDEW042T2 e-paper display driver
https://github.com/mcauser/micropython-waveshare-epaper

MIT License
Copyright (c) 2017 Waveshare
Copyright (c) 2018 Mike Causer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

from micropython import const
from time import sleep_ms
import ustruct

# Display resolution
EPD_WIDTH  = const(296)
EPD_HEIGHT = const(128)

# Display commands
PANEL_SETTING                  = const(0x00)
POWER_SETTING                  = const(0x01)
POWER_OFF                      = const(0x02)
#POWER_OFF_SEQUENCE_SETTING     = const(0x03)
POWER_ON                       = const(0x04)
#POWER_ON_MEASURE               = const(0x05)
BOOSTER_SOFT_START             = const(0x06)
DEEP_SLEEP                     = const(0x07)
DATA_START_TRANSMISSION_1      = const(0x10)
#DATA_STOP                      = const(0x11)
DISPLAY_REFRESH                = const(0x12)
DATA_START_TRANSMISSION_2      = const(0x13)
LUT_FOR_VCOM                   = const(0x20)
LUT_WHITE_TO_WHITE             = const(0x21)
LUT_BLACK_TO_WHITE             = const(0x22)
LUT_WHITE_TO_BLACK             = const(0x23)
LUT_BLACK_TO_BLACK             = const(0x24)
PLL_CONTROL                    = const(0x30)
#TEMPERATURE_SENSOR_COMMAND     = const(0x40)
#TEMPERATURE_SENSOR_SELECTION   = const(0x41)
#TEMPERATURE_SENSOR_WRITE       = const(0x42)
#TEMPERATURE_SENSOR_READ        = const(0x43)
VCOM_AND_DATA_INTERVAL_SETTING = const(0x50)
#LOW_POWER_DETECTION            = const(0x51)
#TCON_SETTING                   = const(0x60)
TCON_RESOLUTION                 = const(0x61)
RESOLUTION_SETTING             = const(0x61)
#GSST_SETTING                   = const(0x65)
#GET_STATUS                     = const(0x71)
#AUTO_MEASUREMENT_VCOM          = const(0x80)
#READ_VCOM_VALUE                = const(0x81)
VCM_DC_SETTING                 = const(0x82)
#PARTIAL_WINDOW                 = const(0x90)
#PARTIAL_IN                     = const(0x91)
#PARTIAL_OUT                    = const(0x92)

#PROGRAM_MODE                   = const(0xA0)
#ACTIVE_PROGRAMMING             = const(0xA1)
#READ_OTP                       = const(0xA2)
#POWER_SAVING                   = const(0xE3)

BUSY = const(0)  # 0=busy, 1=idle

class EPD:
    
    # 44/42 bytes (look up tables)
    LUT_VCOM0 = bytearray(b'\x00\x17\x00\x00\x00\x02\x00\x17\x17\x00\x00\x02\x00\x0A\x01\x00\x00\x01\x00\x0E\x0E\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
    LUT_WW    = bytearray(b'\x40\x17\x00\x00\x00\x02\x90\x17\x17\x00\x00\x02\x40\x0A\x01\x00\x00\x01\xA0\x0E\x0E\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
    LUT_BW    = LUT_WW
    LUT_BB    = bytearray(b'\x80\x17\x00\x00\x00\x02\x90\x17\x17\x00\x00\x02\x80\x0A\x01\x00\x00\x01\x50\x0E\x0E\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
    LUT_WB    = LUT_BB
    
    def __init__(self, spi, cs, dc, rst, busy):
        self.spi = spi
        self.cs = cs
        self.dc = dc
        self.rst = rst
        self.busy = busy
        self.cs.init(self.cs.OUT, value=1)
        self.dc.init(self.dc.OUT, value=0)
        self.rst.init(self.rst.OUT, value=0)
        self.busy.init(self.busy.IN)
        self.width = EPD_WIDTH
        self.height = EPD_HEIGHT

    def _command(self, command, data=None):
        self.dc(0)
        self.cs(0)
        self.spi.write(bytearray([command]))
        self.cs(1)
        if data is not None:
            self._data(data)

    def _data(self, data):
        self.dc(1)
        self.cs(0)
        self.spi.write(data)
        self.cs(1)

    def init(self):
        self.reset()
        self._command(POWER_SETTING, b'\x03\x00\x2B\x2B\xFF') # VDS_EN VDG_EN, VCOM_HV VGHL_LV[1] VGHL_LV[0], VDH, VDL, VDHR
        # self._command(POWER_SETTING, b'\x03\x00\x2B\x2B\x29')
        self._command(BOOSTER_SOFT_START, b'\x17\x17\x17') # 07 0f 17 1f 27 2F 37 2f
        self._command(POWER_ON)
        self.wait_until_idle()
        self._command(PANEL_SETTING, b'\xBF\x0B') # KW-BF   KWR-AF  BWROTP 0f
        # self._command(PANEL_SETTING, b'\xCF')
        self._command(VCOM_AND_DATA_INTERVAL_SETTING, b'\x17')
        self._command(PLL_CONTROL, b'\x3C') # 3A 100HZ   29 150Hz 39 200HZ  31 171HZ
        # self._command(PLL_CONTROL, b'\x39')
        # self._command(TCON_RESOLUTION, bytearray([self.width, self.height>>8, self.height]))
        # self._command(VCM_DC_SETTING, b'\x0E')

    def wait_until_idle(self):
        while self.busy.value() == BUSY:
            sleep_ms(10)

    def reset(self):
        self.rst(0)
        sleep_ms(20)
        self.rst(1)
        sleep_ms(20)

    def set_lut(self):
        self._command(LUT_FOR_VCOM, self.LUT_VCOM0)    # vcom
        self._command(LUT_WHITE_TO_WHITE, self.LUT_WW) # ww --
        self._command(LUT_BLACK_TO_WHITE, self.LUT_BW) # bw r
        self._command(LUT_WHITE_TO_BLACK, self.LUT_BB) # wb w
        self._command(LUT_BLACK_TO_BLACK, self.LUT_WB) # bb b

    # draw the current frame memory
    def display_frame(self, frame_buffer):
        self._command(RESOLUTION_SETTING, ustruct.pack(">HH", EPD_WIDTH, EPD_HEIGHT))
        self._command(VCM_DC_SETTING, b'\x12')
        self._command(VCOM_AND_DATA_INTERVAL_SETTING)
        self._command(0x97) # VBDF 17|D7 VBDW 97  VBDB 57  VBDF F7  VBDW 77  VBDB 37  VBDR B7
        # TODO should ^ this be _data(0x97), not sure what it does

        if frame_buffer:
            """
            self._command(DATA_START_TRANSMISSION_1)
            for i in range(0, self.width * self.height // 8):
                self._data(bytearray([0xFF])) # bit set: white, bit reset: black
            sleep_ms(2)
            """
            
            self._command(DATA_START_TRANSMISSION_2)
            sleep_ms(2)
            print("self.width * self.height // 8 =====", self.width * self.height // 8)
            for i in range(0, self.width * self.height // 8):
                # print(">>>>>i=", i, "<<<<<<111 ")
                self._data(bytearray([frame_buffer[i]]))
                # print(">>>>>i=", i, "<<<<<<111222222222")
            sleep_ms(2)

        self.set_lut()
        self._command(DISPLAY_REFRESH)
        sleep_ms(10)
        self.wait_until_idle()

2、新版本墨水屏驱动:

"""
日期:2022年9月27日
说明:
    1. 此版本对应于2.9寸墨水屏,且是从2022年8月份更新后的版本,之前的老版本墨水屏不通用
    2. 【2022年10月1日】更新:修复文字显示相反的bug
"""

from time import sleep_ms

# Display resolution
EPD_WIDTH  = 296
EPD_HEIGHT = 128


class EPD:
    
    def __init__(self, spi, cs, dc, rst, busy):
        self.spi = spi
        self.cs = cs
        self.dc = dc
        self.rst = rst
        self.busy = busy
        self.cs.init(self.cs.OUT, value=1)
        self.dc.init(self.dc.OUT, value=0)
        self.rst.init(self.rst.OUT, value=0)
        self.busy.init(self.busy.IN)
        self.width = EPD_WIDTH
        self.height = EPD_HEIGHT

    def _command(self, command, data=None):
        sleep_ms(1)
        self.dc(0)
        self.cs(0)
        print("command=", command)
        try:
            self.spi.write(bytearray([command]))
        except:
            self.spi.write(command)
        self.cs(1)
        if data is not None:
            self._data(data)

    def _data(self, data):
        sleep_ms(1)
        self.cs(0)
        self.dc(1)
        self.spi.write(data)
        self.cs(1)

    def init(self):
        self.reset()
        self.wait_until_idle()
        self._command(b'\x12')
        self.wait_until_idle()

        self._command(b'\x01')  # Driver output control      
        self._data(b'\x27')
        self._data(b'\x01')
        self._data(b'\x00')

        self._command(b'\x11')  # data entry mode       
        self._data(b'\x03')  # 这里影响内容镜像

        self._command(b'\x44')  # set Ram-X address start/end position   
        self._data(b'\x00')  # X起始点为0(1个字节)
        self._data(b'\x0F')  # X终止点为(1个字节)0x0F-->(15+1)*8=128

        self._command(b'\x45')  # set Ram-Y address start/end position          
        self._data(b'\x00')  # Y设置起始点为 0(2个字节)
        self._data(b'\x00') 
        self._data(b'\x27')  # 终止点为(2个字节):0x0127-->(295+1)=296
        self._data(b'\x01')

        self._command(b'\x3C')  # BorderWavefrom
        self._data(b'\x05')  

        self._command(b'\x21')  # Display update control
        self._data(b'\x00')    
        self._data(b'\x80')          

        self._command(b'\x18')  # Read built-in temperature sensor
        self._data(b'\x80')  

        self._command(b'\x4E')  # set RAM x address count to 0
        self._data(b'\x00')
        self._command(b'\x4F')  # set RAM y address count to 0X199    
        self._data(b'\x27')
        self._data(b'\x01')
        self.wait_until_idle()


    def wait_until_idle(self):
        while True:
            if self.busy.value() == 0:  # 1 busy 
                break
            sleep_ms(10)

    def reset(self):
        self.rst(0)
        sleep_ms(10)
        self.rst(1)
        sleep_ms(10)

    def display_frame(self, frame_buffer):
        self._command(b'\x24')

        if frame_buffer:
            print("self.width * self.height // 8 =====", self.width * self.height // 8)
            for i in range(0, self.width * self.height // 8):
                # print(">>>>>i=", i, "<<<<<<111 ")
                self._data(bytearray([frame_buffer[i]]))
                # print(">>>>>i=", i, "<<<<<<111222222222")
            sleep_ms(1)

        self.epd_udpate()

    def epd_udpate(self):
        self._command(b'\x22')  # Display Update Control
        self._data(b'\xF7')   
        self._command(b'\x20')  # Activate Display Update Sequence
        self.wait_until_idle()

五、墨水屏显示图片

        1、准备图片。制作1个296x128像素的图片,如果图片的格式需要转换为jpg格式。

       

         2,使用工具image2lcd转变图片为程序格式。工具从百度自行下载,或者从下方分享下载。

 程序会保存为一个.C的文件,我们打开文件,复制里面的十六进制数据:

         3,打开Thonny IDE,新建一个Python文件,命名为image_array.py,把上一步的十六进制数据粘贴在代码里面:

# 128 x 296
image_array = bytearray([0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X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F,0X80,0X3F,0XFF,0X00,0X1E,0X00,0X00,0X00,0X1E,0X00,0X07,0XFF,0XFF,
0XFF,0XFF,0XFF,0X80,0X3F,0XFF,0X00,0X1C,0X00,0X00,0X00,0X1F,0X80,0X07,0XFF,0XFF,
0XFF,0XFF,0XFF,0X80,0X3F,0X7F,0X00,0X38,0X00,0X00,0X00,0X1F,0X00,0X07,0XFF,0XFF,
0XFF,0XFF,0XFF,0X80,0X3F,0X1F,0X00,0X38,0X00,0X00,0X00,0X1F,0X1C,0X07,0XFF,0XFF,
0XFF,0XFF,0XFF,0X80,0X3E,0X1F,0X00,0X00,0X00,0X00,0X00,0X1C,0X3E,0X07,0XFF,0XFF,
0XFF,0XFF,0XFF,0X80,0X3C,0X1E,0X00,0X00,0X00,0X00,0X00,0X18,0XFF,0X07,0XFF,0XFF,
0XFF,0XFF,0XFF,0X80,0X38,0X0E,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0X0F,0XFF,0XFF,
0XFF,0XFF,0XFF,0X80,0X30,0X0C,0X00,0X00,0X00,0X00,0X00,0X01,0XFE,0X0F,0XFF,0XFF,
0XFF,0XFF,0XFF,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XFE,0X0F,0XFF,0XFF,
0XFF,0XFF,0XFF,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X07,0XFE,0X0F,0XFF,0XFF,
0XFF,0XFF,0XFF,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X07,0XFE,0X0F,0XFF,0XFF,
0XFF,0XFF,0XDF,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X07,0XFC,0X0F,0XFF,0XFF,
0XFF,0XFF,0X9F,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XFC,0X0F,0XFF,0XFF,
0XFF,0XFF,0X9F,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0XF8,0X0F,0XFF,0XFF,
0XFF,0XFF,0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Pin, SPI
import framebuf
import epaper


# 1. 创建对应的引脚
miso = Pin(19)
mosi = Pin(23)
sck = Pin(18)
cs = Pin(33)
dc = Pin(32)
rst = Pin(19)
busy = Pin(35)
spi = SPI(2, baudrate=10000000, polarity=0, phase=0, sck=sck, miso=miso, mosi=mosi)

# 2. 创建墨水屏驱动对象
e = epaper.EPD(spi, cs, dc, rst, busy)
e.init()

# 3. 定义要显示的内容宽度高度
w = 296
h = 128

# 4. 创建需要的对象
buf = bytearray(w * h // 8)  # 296 * 128 // 8 = 4736
fb = framebuf.FrameBuffer(buf, h, w, framebuf.MONO_HLSB)


def show_black_white():
    black = 0
    white = 1
    fb.fill(white)
    # fb.fill(black)
    e.display_frame(buf)


def show_image():
    from image_array import image_array
    # 注意:实际的图片多大这里就写多大,例如实际的图片是118x296,那么就将下面的128改为118
    fbImage = framebuf.FrameBuffer(image_array, 128, 296,  framebuf.MONO_HLSB)
    fb.blit(fbImage, 0, 0)
    e.display_frame(buf)


if __name__ == "__main__":
    # show_black_white()
    show_image()

效果如下:

 六、墨水屏显示文字

        上面我们的test.py中使用了framebuf库,原来的这个库不能调整显示文字的方向。我们更新下这个库,使用它可以4个方向任意调整和可以放大字体。字体库在文末下载。

newframebuf.py

# SPDX-FileCopyrightText: <text> 2018 Kattni Rembor, Melissa LeBlanc-Williams
# and Tony DiCola, for Adafruit Industries.
# Original file created by Damien P. George </text>
#
# SPDX-License-Identifier: MIT

"""
`adafruit_framebuf`
====================================================
CircuitPython pure-python framebuf module, based on the micropython framebuf module.
Implementation Notes
--------------------
**Hardware:**
* `Adafruit SSD1306 OLED displays <https://www.adafruit.com/?q=ssd1306>`_
**Software and Dependencies:**
* Adafruit CircuitPython firmware for the supported boards:
  https://github.com/adafruit/circuitpython/releases
"""

__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_framebuf.git"

import os
import struct

# Framebuf format constants:
MVLSB = 0  # Single bit displays (like SSD1306 OLED)
RGB565 = 1  # 16-bit color displays
GS4_HMSB = 2  # Unimplemented!
MHMSB = 3  # Single bit displays like the Sharp Memory
RGB888 = 4  # Neopixels and Dotstars


class MHMSBFormat:
    """MHMSBFormat"""

    @staticmethod
    def set_pixel(framebuf, x, y, color):
        """Set a given pixel to a color."""
        index = (y * framebuf.stride + x) // 8
        offset = 7 - x & 0x07
        framebuf.buf[index] = (framebuf.buf[index] & ~(0x01 << offset)) | (
            (color != 0) << offset
        )

    @staticmethod
    def get_pixel(framebuf, x, y):
        """Get the color of a given pixel"""
        index = (y * framebuf.stride + x) // 8
        offset = 7 - x & 0x07
        return (framebuf.buf[index] >> offset) & 0x01

    @staticmethod
    def fill(framebuf, color):
        """completely fill/clear the buffer with a color"""
        if color:
            fill = 0xFF
        else:
            fill = 0x00
        for i in range(len(framebuf.buf)):  # pylint: disable=consider-using-enumerate
            framebuf.buf[i] = fill

    @staticmethod
    def fill_rect(framebuf, x, y, width, height, color):
        """Draw a rectangle at the given location, size and color. The ``fill_rect`` method draws
        both the outline and interior."""
        # pylint: disable=too-many-arguments
        for _x in range(x, x + width):
            offset = 7 - _x & 0x07
            for _y in range(y, y + height):
                index = (_y * framebuf.stride + _x) // 8
                framebuf.buf[index] = (framebuf.buf[index] & ~(0x01 << offset)) | (
                    (color != 0) << offset
                )


class MVLSBFormat:
    """MVLSBFormat"""

    @staticmethod
    def set_pixel(framebuf, x, y, color):
        """Set a given pixel to a color."""
        index = (y >> 3) * framebuf.stride + x
        offset = y & 0x07
        framebuf.buf[index] = (framebuf.buf[index] & ~(0x01 << offset)) | (
            (color != 0) << offset
        )

    @staticmethod
    def get_pixel(framebuf, x, y):
        """Get the color of a given pixel"""
        index = (y >> 3) * framebuf.stride + x
        offset = y & 0x07
        return (framebuf.buf[index] >> offset) & 0x01

    @staticmethod
    def fill(framebuf, color):
        """completely fill/clear the buffer with a color"""
        if color:
            fill = 0xFF
        else:
            fill = 0x00
        for i in range(len(framebuf.buf)):  # pylint: disable=consider-using-enumerate
            framebuf.buf[i] = fill

    @staticmethod
    def fill_rect(framebuf, x, y, width, height, color):
        """Draw a rectangle at the given location, size and color. The ``fill_rect`` method draws
        both the outline and interior."""
        # pylint: disable=too-many-arguments
        while height > 0:
            index = (y >> 3) * framebuf.stride + x
            offset = y & 0x07
            for w_w in range(width):
                framebuf.buf[index + w_w] = (
                    framebuf.buf[index + w_w] & ~(0x01 << offset)
                ) | ((color != 0) << offset)
            y += 1
            height -= 1


class RGB888Format:
    """RGB888Format"""

    @staticmethod
    def set_pixel(framebuf, x, y, color):
        """Set a given pixel to a color."""
        index = (y * framebuf.stride + x) * 3
        if isinstance(color, tuple):
            framebuf.buf[index : index + 3] = bytes(color)
        else:
            framebuf.buf[index : index + 3] = bytes(
                ((color >> 16) & 255, (color >> 8) & 255, color & 255)
            )

    @staticmethod
    def get_pixel(framebuf, x, y):
        """Get the color of a given pixel"""
        index = (y * framebuf.stride + x) * 3
        return (
            (framebuf.buf[index] << 16)
            | (framebuf.buf[index + 1] << 8)
            | framebuf.buf[index + 2]
        )

    @staticmethod
    def fill(framebuf, color):
        """completely fill/clear the buffer with a color"""
        fill = (color >> 16) & 255, (color >> 8) & 255, color & 255
        for i in range(0, len(framebuf.buf), 3):
            framebuf.buf[i : i + 3] = bytes(fill)

    @staticmethod
    def fill_rect(framebuf, x, y, width, height, color):
        """Draw a rectangle at the given location, size and color. The ``fill_rect`` method draws
        both the outline and interior."""
        # pylint: disable=too-many-arguments
        fill = (color >> 16) & 255, (color >> 8) & 255, color & 255
        for _x in range(x, x + width):
            for _y in range(y, y + height):
                index = (_y * framebuf.stride + _x) * 3
                framebuf.buf[index : index + 3] = bytes(fill)


class FrameBuffer:
    """FrameBuffer object.
    :param buf: An object with a buffer protocol which must be large enough to contain every
                pixel defined by the width, height and format of the FrameBuffer.
    :param width: The width of the FrameBuffer in pixel
    :param height: The height of the FrameBuffer in pixel
    :param buf_format: Specifies the type of pixel used in the FrameBuffer; permissible values
                        are listed under Constants below. These set the number of bits used to
                        encode a color value and the layout of these bits in ``buf``. Where a
                        color value c is passed to a method, c is  a small integer with an encoding
                        that is dependent on the format of the FrameBuffer.
    :param stride: The number of pixels between each horizontal line of pixels in the
                   FrameBuffer. This defaults to ``width`` but may need adjustments when
                   implementing a FrameBuffer within another larger FrameBuffer or screen. The
                   ``buf`` size must accommodate an increased step size.
    """

    def __init__(self, buf, width, height, buf_format=MVLSB, stride=None):
        # pylint: disable=too-many-arguments
        self.buf = buf
        self.width = width
        self.height = height
        self.stride = stride
        self._font = None
        if self.stride is None:
            self.stride = width
        if buf_format == MVLSB:
            self.format = MVLSBFormat()
        elif buf_format == MHMSB:
            self.format = MHMSBFormat()
        elif buf_format == RGB888:
            self.format = RGB888Format()
        else:
            raise ValueError("invalid format")
        self._rotation = 0

    @property
    def rotation(self):
        """The rotation setting of the display, can be one of (0, 1, 2, 3)"""
        return self._rotation

    @rotation.setter
    def rotation(self, val):
        if not val in (0, 1, 2, 3):
            raise RuntimeError("Bad rotation setting")
        self._rotation = val

    def fill(self, color):
        """Fill the entire FrameBuffer with the specified color."""
        self.format.fill(self, color)

    def fill_rect(self, x, y, width, height, color):
        """Draw a rectangle at the given location, size and color. The ``fill_rect`` method draws
        both the outline and interior."""
        # pylint: disable=too-many-arguments, too-many-boolean-expressions
        self.rect(x, y, width, height, color, fill=True)

    def pixel(self, x, y, color=None):
        """If ``color`` is not given, get the color value of the specified pixel. If ``color`` is
        given, set the specified pixel to the given color."""
        if self.rotation == 1:
            x, y = y, x
            x = self.width - x - 1
        if self.rotation == 2:
            x = self.width - x - 1
            y = self.height - y - 1
        if self.rotation == 3:
            x, y = y, x
            y = self.height - y - 1

        if x < 0 or x >= self.width or y < 0 or y >= self.height:
            return None
        if color is None:
            return self.format.get_pixel(self, x, y)
        self.format.set_pixel(self, x, y, color)
        return None

    def hline(self, x, y, width, color):
        """Draw a horizontal line up to a given length."""
        self.rect(x, y, width, 1, color, fill=True)

    def vline(self, x, y, height, color):
        """Draw a vertical line up to a given length."""
        self.rect(x, y, 1, height, color, fill=True)

    def circle(self, center_x, center_y, radius, color):
        """Draw a circle at the given midpoint location, radius and color.
        The ```circle``` method draws only a 1 pixel outline."""
        x = radius - 1
        y = 0
        d_x = 1
        d_y = 1
        err = d_x - (radius << 1)
        while x >= y:
            self.pixel(center_x + x, center_y + y, color)
            self.pixel(center_x + y, center_y + x, color)
            self.pixel(center_x - y, center_y + x, color)
            self.pixel(center_x - x, center_y + y, color)
            self.pixel(center_x - x, center_y - y, color)
            self.pixel(center_x - y, center_y - x, color)
            self.pixel(center_x + y, center_y - x, color)
            self.pixel(center_x + x, center_y - y, color)
            if err <= 0:
                y += 1
                err += d_y
                d_y += 2
            if err > 0:
                x -= 1
                d_x += 2
                err += d_x - (radius << 1)

    def rect(self, x, y, width, height, color, *, fill=False):
        """Draw a rectangle at the given location, size and color. The ```rect``` method draws only
        a 1 pixel outline."""
        # pylint: disable=too-many-arguments
        if self.rotation == 1:
            x, y = y, x
            width, height = height, width
            x = self.width - x - width
        if self.rotation == 2:
            x = self.width - x - width
            y = self.height - y - height
        if self.rotation == 3:
            x, y = y, x
            width, height = height, width
            y = self.height - y - height

        # pylint: disable=too-many-boolean-expressions
        if (
            width < 1
            or height < 1
            or (x + width) <= 0
            or (y + height) <= 0
            or y >= self.height
            or x >= self.width
        ):
            return
        x_end = min(self.width - 1, x + width - 1)
        y_end = min(self.height - 1, y + height - 1)
        x = max(x, 0)
        y = max(y, 0)
        if fill:
            self.format.fill_rect(self, x, y, x_end - x + 1, y_end - y + 1, color)
        else:
            self.format.fill_rect(self, x, y, x_end - x + 1, 1, color)
            self.format.fill_rect(self, x, y, 1, y_end - y + 1, color)
            self.format.fill_rect(self, x, y_end, x_end - x + 1, 1, color)
            self.format.fill_rect(self, x_end, y, 1, y_end - y + 1, color)

    def line(self, x_0, y_0, x_1, y_1, color):
        # pylint: disable=too-many-arguments
        """Bresenham's line algorithm"""
        d_x = abs(x_1 - x_0)
        d_y = abs(y_1 - y_0)
        x, y = x_0, y_0
        s_x = -1 if x_0 > x_1 else 1
        s_y = -1 if y_0 > y_1 else 1
        if d_x > d_y:
            err = d_x / 2.0
            while x != x_1:
                self.pixel(x, y, color)
                err -= d_y
                if err < 0:
                    y += s_y
                    err += d_x
                x += s_x
        else:
            err = d_y / 2.0
            while y != y_1:
                self.pixel(x, y, color)
                err -= d_x
                if err < 0:
                    x += s_x
                    err += d_y
                y += s_y
        self.pixel(x, y, color)

    def blit(self):
        """blit is not yet implemented"""
        raise NotImplementedError()

    def scroll(self, delta_x, delta_y):
        """shifts framebuf in x and y direction"""
        if delta_x < 0:
            shift_x = 0
            xend = self.width + delta_x
            dt_x = 1
        else:
            shift_x = self.width - 1
            xend = delta_x - 1
            dt_x = -1
        if delta_y < 0:
            y = 0
            yend = self.height + delta_y
            dt_y = 1
        else:
            y = self.height - 1
            yend = delta_y - 1
            dt_y = -1
        while y != yend:
            x = shift_x
            while x != xend:
                self.format.set_pixel(
                    self, x, y, self.format.get_pixel(self, x - delta_x, y - delta_y)
                )
                x += dt_x
            y += dt_y

    # pylint: disable=too-many-arguments
    def text(self, string, x, y, color, *, font_name="font5x8.bin", size=1):
        """Place text on the screen in variables sizes. Breaks on \n to next line.
        Does not break on line going off screen.
        """
        # determine our effective width/height, taking rotation into account
        frame_width = self.width
        frame_height = self.height
        if self.rotation in (1, 3):
            frame_width, frame_height = frame_height, frame_width

        for chunk in string.split("\n"):
            if not self._font or self._font.font_name != font_name:
                # load the font!
                self._font = BitmapFont(font_name)
            width = self._font.font_width
            height = self._font.font_height
            for i, char in enumerate(chunk):
                char_x = x + (i * (width + 1)) * size
                if (
                    char_x + (width * size) > 0
                    and char_x < frame_width
                    and y + (height * size) > 0
                    and y < frame_height
                ):
                    self._font.draw_char(char, char_x, y, self, color, size=size)
            y += height * size

    # pylint: enable=too-many-arguments

    def image(self, img):
        """Set buffer to value of Python Imaging Library image.  The image should
        be in 1 bit mode and a size equal to the display size."""
        # determine our effective width/height, taking rotation into account
        width = self.width
        height = self.height
        if self.rotation in (1, 3):
            width, height = height, width

        if isinstance(self.format, RGB888Format) and img.mode != "RGB":
            raise ValueError("Image must be in mode RGB.")
        if isinstance(self.format, (MHMSBFormat, MVLSBFormat)) and img.mode != "1":
            raise ValueError("Image must be in mode 1.")

        imwidth, imheight = img.size
        if imwidth != width or imheight != height:
            raise ValueError(
                "Image must be same dimensions as display ({0}x{1}).".format(
                    width, height
                )
            )
        # Grab all the pixels from the image, faster than getpixel.
        pixels = img.load()
        # Clear buffer
        for i in range(len(self.buf)):  # pylint: disable=consider-using-enumerate
            self.buf[i] = 0
        # Iterate through the pixels
        for x in range(width):  # yes this double loop is slow,
            for y in range(height):  #  but these displays are small!
                if img.mode == "RGB":
                    self.pixel(x, y, pixels[(x, y)])
                elif pixels[(x, y)]:
                    self.pixel(x, y, 1)  # only write if pixel is true


# MicroPython basic bitmap font renderer.
# Author: Tony DiCola
# License: MIT License (https://opensource.org/licenses/MIT)
class BitmapFont:
    """A helper class to read binary font tiles and 'seek' through them as a
    file to display in a framebuffer. We use file access so we dont waste 1KB
    of RAM on a font!"""

    def __init__(self, font_name="font5x8.bin"):
        # Specify the drawing area width and height, and the pixel function to
        # call when drawing pixels (should take an x and y param at least).
        # Optionally specify font_name to override the font file to use (default
        # is font5x8.bin).  The font format is a binary file with the following
        # format:
        # - 1 unsigned byte: font character width in pixels
        # - 1 unsigned byte: font character height in pixels
        # - x bytes: font data, in ASCII order covering all 255 characters.
        #            Each character should have a byte for each pixel column of
        #            data (i.e. a 5x8 font has 5 bytes per character).
        self.font_name = font_name

        # Open the font file and grab the character width and height values.
        # Note that only fonts up to 8 pixels tall are currently supported.
        try:
            self._font = open(  # pylint: disable=consider-using-with
                self.font_name, "rb"
            )
            self.font_width, self.font_height = struct.unpack("BB", self._font.read(2))
            # simple font file validation check based on expected file size
            if 2 + 256 * self.font_width != os.stat(font_name)[6]:
                raise RuntimeError("Invalid font file: " + font_name)
        except OSError:
            print("Could not find font file", font_name)
            raise
        except OverflowError:
            # os.stat can throw this on boards without long int support
            # just hope the font file is valid and press on
            pass

    def deinit(self):
        """Close the font file as cleanup."""
        self._font.close()

    def __enter__(self):
        """Initialize/open the font file"""
        self.__init__()
        return self

    def __exit__(self, exception_type, exception_value, traceback):
        """cleanup on exit"""
        self.deinit()

    def draw_char(
        self, char, x, y, framebuffer, color, size=1
    ):  # pylint: disable=too-many-arguments
        """Draw one character at position (x,y) to a framebuffer in a given color"""
        size = max(size, 1)
        # Don't draw the character if it will be clipped off the visible area.
        # if x < -self.font_width or x >= framebuffer.width or \
        #   y < -self.font_height or y >= framebuffer.height:
        #    return
        # Go through each column of the character.
        for char_x in range(self.font_width):
            # Grab the byte for the current column of font data.
            self._font.seek(2 + (ord(char) * self.font_width) + char_x)
            try:
                line = struct.unpack("B", self._font.read(1))[0]
            except RuntimeError:
                continue  # maybe character isnt there? go to next
            # Go through each row in the column byte.
            for char_y in range(self.font_height):
                # Draw a pixel for each bit that's flipped on.
                if (line >> char_y) & 0x1:
                    framebuffer.fill_rect(
                        x + char_x * size, y + char_y * size, size, size, color
                    )

    def width(self, text):
        """Return the pixel width of the specified text message."""
        return len(text) * (self.font_width + 1)


class FrameBuffer1(FrameBuffer):  # pylint: disable=abstract-method
    """FrameBuffer1 object. Inherits from FrameBuffer."""
    pass

        我们来测试下,新建一个文件test1.py

from machine import Pin, SPI
import newframebuf
import time
import epaper

    
def show_text():
    black = 0
    white = 1
    fb.fill(white)
    fb.text('Welcome to China!', 20, 10, black, size=2)
    """
    e.display_frame(buf)
    time.sleep(0.5)
    fb.pixel(30, 10, black)
    e.display_frame(buf)
    time.sleep(0.5)
    fb.hline(30, 30, 10, black)
    e.display_frame(buf)
    time.sleep(0.5)
    fb.vline(30, 50, 10, black)
    fb.line(30, 70, 40, 80, black)
    fb.rect(30, 90, 10, 10, black)
    fb.fill_rect(30, 110, 10, 10, black)
    for row in range(0,36):
        fb.text(str(row), 0, row*8, black)
    fb.text('Line 36', 0, 268, black)
    """
    e.display_frame(buf)
    

if __name__ == "__main__":
    # 1. 创建对应的引脚
    miso = Pin(19)
    mosi = Pin(23)
    sck = Pin(18)
    cs = Pin(33)
    dc = Pin(32)
    rst = Pin(19)
    busy = Pin(35)
    spi = SPI(2, baudrate=10000000, polarity=0, phase=0, sck=sck, miso=miso, mosi=mosi)

    # 2. 创建墨水屏驱动对象
    e = epaper.EPD(spi, cs, dc, rst, busy)
    e.init()

    # 3. 定义要显示的内容宽度高度
    w = 296
    h = 128

    # 4. 创建需要的对象
    buf = bytearray(w * h // 8)  # 296 * 128 // 8 = 4736
    fb = newframebuf.FrameBuffer(buf, h, w, newframebuf.MHMSB)
    fb.rotation = 3  # 调整显示的方向,可以在0/1/2/3之间选择

    # 5. 显示文字
    show_text()

演示效果:

 

七、墨水屏连接WIFI显示日历加图片

        我们上面讲解了图片和文字的显示,下面我们将他们结合起来做。

        1,图片制作

百度搜索一个你想要的图片,使用截图软件Snipaste进行截图,保存为jpg格式。

       

然后转化为十六进制

 创建一个新的image_array.py文件

# 128 x 296
image_array = bytearray([0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0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,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF])

创键新的test2.py文件

from machine import Pin, SPI, RTC
import newframebuf
import framebuf
import time
import epaper
import ntptime
import network


# 记录上次矩形的左上角
last_rect_x = 0
last_rect_y = 0
# 记录上次显示的所有数字左上角
last_number_x_y = []


def get_week_with_data(y,m,d):
    '''根据年月日计算星期几'''
    y = y - 1 if m == 1 or m == 2 else y
    m = 13 if m == 1 else (14 if m == 2 else m)
    w = (d + 2 * m + 3 * (m + 1) // 5 + y + y // 4 - y // 100 + y // 400) % 7 + 1
    return w


def is_leap_year(y):
    if y%400==0 or (y%4==0 and y%100!=0):
        return True
    return  False


def get_days_in_month(y,m):
    if m in [1, 3, 5, 7, 8, 10, 12]:
        return 31
    elif m in [4, 6, 9, 11]:
        return 30
    else:
        return 29 if is_leap_year(y) else 28
    

def connect_wifi(wifi, password):
    wlan = network.WLAN(network.STA_IF)
    wlan.active(True)
    if not wlan.isconnected():
        wlan.connect(wifi, password)


def ntp():
    # 链接互联网
    connect_wifi("名字", "密码")  # WIFI名字密码
    time.sleep(2)
    ntptime.host="ntp1.aliyun.com"
    ntptime.NTP_DELTA = 3155644800  # 东八区 UTC+8偏移时间(秒)
    try:
        ntptime.settime()
        print("联网成功...")
    except Exception as e:
        pass


def show_text(year, month, day):
    global last_rect_x, last_rect_y, last_number_x_y
    
    # 清空上次显示的数字
    for content, x, y in last_number_x_y:
        fb.text(content, x, y, white)
        
    # 清空列表
    last_number_x_y = []
    
    # 1.提示用户输入年月
    year = year
    mouth = month
    # 2.计算这个月有多少天
    days = get_days_in_month(year, mouth)
    # 3.按照指定格式显示日期
    print('一 二 三 四 五 六 日')
    fb.text(' Mon Tus Wed Thu Fri Sat Sun', 0, 15, black)
    content = '-' * 30
    print(content)
    # fb.text(content, 0, 30, black)
    fb.hline(0, 30, 180, black)
    content = ""
    row = 3
    today_row = 0
    today_col = 0
    for i in range(1, days + 1):
        w = get_week_with_data(year, mouth, i)

        if i == 1:
            content = content + '    ' * (w-1)
            # print(content, end="*")
            
        else:
            if w == 1:
                print(content)
                fb.text(content, 0, row * 15 - 5, black)
                last_number_x_y.append([content, 0, row * 15 - 5])
                row += 1
                content = ""
        content = content + f"  {i:2d}"
        
        if i == day:
            today_row = row
            today_col = w

    if content:
        print(content)
        fb.text(content, 0, row * 15 - 5, black)
        last_number_x_y.append([content, 0, row * 15 - 5])
    
    rect_x = (today_col - 1) * 24 + 5
    rect_y = today_row * 15 - 8
    

    if last_rect_x != 0 and last_rect_y != 0:
        print("last_rect_x=%d, last_rect_y=%d" % (last_rect_x, last_rect_y))
        fb.rect(last_rect_x, last_rect_y, 22, 14, white)
    
    last_rect_x, last_rect_y = rect_x, rect_y

    fb.rect(rect_x, rect_y,  22, 14, black)
    
    # fb.text('hello World', 0, 0, black, size=2)
    e.display_frame(buf)  # 刷新显示


if __name__ == "__main__":
    # 1. 创建对应的引脚
    miso = Pin(19)
    mosi = Pin(23)
    sck = Pin(18)
    cs = Pin(33)
    dc = Pin(32)
    rst = Pin(19)
    busy = Pin(35)
    spi = SPI(2, baudrate=10000000, polarity=0, phase=0, sck=sck, miso=miso, mosi=mosi)

    # 2. 创建墨水屏驱动对象
    e = epaper.EPD(spi, cs, dc, rst, busy)
    e.init()

    # 3. 导入需要的背景图
    from image_array import image_array

    # 4. 定义要显示的内容宽度高度
    w = 296
    h = 128
    # 注意:实际的图片多大这里就写多大
    buf = image_array
    # buf = bytearray(w * h // 8)  # 296 * 128 // 8 = 4736 空白
    black = 0
    white = 1

    # 5. 以背景图为基础创建缓存区
    fb = newframebuf.FrameBuffer(buf, h, w, newframebuf.MHMSB)
    # fb.fill(white)  # 清空内容
    fb.rotation = 3  # 调整显示的方向,可以在0/1/2/3之间选择
    
    # 6. 联网 便于获取互联网时间
    rtc = RTC()
    ntp()

    # 7. 显示文字
    date = rtc.datetime()
    show_text(date[0], date[1], date[2])  # 年月日

演示效果

 

 

八、资料下载

        本文代码,图片,工具比较多,我一起打包放在了下面链接:
链接: https://pan.baidu.com/s/1hvjEXYPzAbvRjqcZ1epEKA 提取码: 2rvi 复制这段内容后打开百度网盘手机App,操作更方便哦

五、购买

某宝链接如下:

https://item.taobao.com/item.htm?spm=a1z09.2.0.0.5ca42e8doe2jPd&id=627397618004&_u=9p01rch2819

 

2.9寸墨水屏资料链接:https://pan.baidu.com/s/1IZYnwmiBnMc2tnWwtxhslQ 
提取码:8888

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/76943.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

VIIF:自监督:自适应:GAN

Self-supervised feature adaption for infrared and visible image fusion &#xff08;红外和可见光图像融合的自监督特征自适应&#xff09; 总述&#xff1a;首先&#xff0c;我们采用编码器网络来提取自适应特征。然后&#xff0c;利用两个具有注意机制块的解码器以自我…

【扫描PDF】如何将颜色淡的扫描PDF颜色变深,便于阅读??PDF中文字太淡怎么加深?汇总网上已有的方法,一波小结

一、问题背景 如果你扫描得到的PDF&#xff0c;像下图一样文字颜色非常淡&#xff0c;看起来不舒服&#xff0c;需要加深处理&#xff0c;就烦请看我下面的几个解决方法&#xff0c;都是从网上汇总得到&#xff0c;加上自己的实践和体会总结。 二、Adobe Acrobat DC PDF扫描…

20221209英语学习

今日新词&#xff1a; receiver n.收受者; 收件人; 接待者; (电话)听筒, 耳机; 收音机; (电视)接收机; 接收器; 接球手 annoy n.同“annoyance” delight n.快乐&#xff0c;愉快 railroad n.铁路, 铁道, 铁路公司, 铁路系统 brilliance n.光辉, 【光】辉度, 漂亮, (名声)…

3.IOC之注解配置

1.编写Spring框架核心配置文件applicationContext.xml 在项目目录“/src/main/resources”下新建applicationContext.xml文件&#xff0c;具体代码如下。 <?xml version"1.0" encoding"UTF-8"?> <beans xmlns"http://www.springframework…

Google如何增加外链?谷歌外链自动化靠谱吗?

Google如何增加外链&#xff1f; 答案是&#xff1a;循序渐进增加免费开放性注册的外链和GPB外链 我们在发布Google外链的时候&#xff0c;总想找捷径&#xff0c;通过软件工具自动发布外链来提高网站排名和流量&#xff0c;加快SEO优化进度&#xff0c;缩短时间成本&#xf…

ChatGPT:构建与人类聊天一样自然的机器人

ChatGPT&#xff1a;构建与人类聊天一样自然的机器人 —— ChatGPT 文章目录ChatGPT&#xff1a;构建与人类聊天一样自然的机器人 —— ChatGPT1 官网2 注册OpenAI账号3 使用ChatGPT3.1 普通聊天3.2 生成代码3.3 写诗3.4 解一道算法题4 ChatGPT中文版VsCode 插件5 一些体会Hi&a…

浅析即时通讯开发之RTMP数据传输协议的实时流媒体

近年来,随着网络带宽的提升,以及多媒体压缩编码技术的发展,流媒体技术得到了非常广泛的应用。全球的流媒体市场正在以极高的速度向前发展,并逐步取代了以文本和图片为主的传统互联网。根据Cisco的VisualNetworkingIndex(VNI)统计,2005年流媒体流量仅占全球互联网总流量的5%,而到…

【玩转c++】c++模板和泛型编程

本期主题&#xff1a;c模板和泛型编程博客主页&#xff1a;小峰同学分享小编的在Linux中学习到的知识和遇到的问题小编的能力有限&#xff0c;出现错误希望大家不吝赐身为程序员&#xff0c;不会有人没女朋友吧&#xff01;&#xff01; 目录 &#x1f341;1.泛型编程 &#x…

ChatGPT 是何方神圣?为什么这么猛?

哈喽&#xff0c;大家好&#xff0c;我是木易巷&#xff01; 本篇文章给大家介绍一下这个很猛的玩意&#xff1a;ChatGPT &#xff01;&#xff01;&#xff01; 什么是ChatGPT &#xff1f; 在12月初&#xff0c;人工智能实验室OpenAI发布了一款名为ChatGPT的自然语言生成式…

【Pytorch】第 5 章 :解决多臂老虎机问题

&#x1f50e;大家好&#xff0c;我是Sonhhxg_柒&#xff0c;希望你看完之后&#xff0c;能对你有所帮助&#xff0c;不足请指正&#xff01;共同学习交流&#x1f50e; &#x1f4dd;个人主页&#xff0d;Sonhhxg_柒的博客_CSDN博客 &#x1f4c3; &#x1f381;欢迎各位→点赞…

web期末网站设计大作业 HTML+CSS+JS仿爱奇艺官网影视网站

HTML实例网页代码, 本实例适合于初学HTML的同学。该实例里面有设置了css的样式设置&#xff0c;有div的样式格局&#xff0c;这个实例比较全面&#xff0c;有助于同学的学习,本文将介绍如何通过从头开始设计个人网站并将其转换为代码的过程来实践设计。 文章目录一、网页介绍一…

《Linux运维实战:使用Percona Backup for MongoDB物理备份与恢复Mongodb数据》

一、备份与恢复方案 Percona Server for MongoDB Percona Server for MongoDB是一个免费的、增强的、完全兼容的、源代码可用的、带有企业级功能的MongoDB Community Edition的替代品。它不需要对MongoDB应用程序或代码进行更改。 参考官方&#xff1a;Percona Backup for Mon…

我的博客系统[Servlet]

目录 后端程序 1. 需求分析 2. 概要设计 3. 编写数据库操作的代码 3.1.使用maven,引入依赖 3.2 封装 数据库的 DataSource 3.2.1 使用单例模式,把数据库的 DataSource 和 建立连接 还有 断开连接也给封装进去 3.2.2 创建实体类 3.2.3 针对这两个实体类涉及到的 增删改…

近期Java杂项问题

Data不会为static变量提供get/set。 Data不会为final变量提供set。 ConfigurationProperties加载static静态属性为null的问题 解决&#xff1a;ConfigurationProperties默认是调用非static Setter方法&#xff0c;把静态的Setter方法的static去掉就可以了 Value注入静态属性 解…

RK3568平台开发系列讲解(系统优化篇)排查卡顿的工具介绍

🚀返回专栏总目录 文章目录 一、Traceview二、Nanoscope三、systrace四、Simpleperf沉淀、分享、成长,让自己和他人都能有所收获!😄 📢Android底层基于 Linux 内核,像 systrace、Simpleperf 也是利用 Linux 提供的机制实现,因此学习一些 Linux 的基础知识,对于理解这…

D-Wave最新调研!量子计算商业活动和投资不断增长

&#xff08;图片来源&#xff1a;网络&#xff09; 加拿大量子计算公司委托高性能计算分析机构Hyperion Research进行了一项研究&#xff0c;以更好地了解量子计算 (QC) 的商业早期采用者所面临的挑战和机遇。这项研究调查了全球范围内的300家目前接触量子计算的企业&#xff…

计算机组成大题分析(六)

假定计算机的主频为 500MHz &#xff0c;CPI 为4。现有设备A 和 B&#xff0c;其数据传输率分别为2MB/s 和 40MB/s &#xff0c;对应 I/O 接口中各有一个 32 位数据缓冲寄存器。请回答下列问题&#xff0c;要求给出计算过程。 (1) 若设备 A 采用定时查询 I/O 方式&#xff0c;每…

为什么说函数组件要比类组件好呢,函数组件和类组件的区别你都清楚吗

一、类组件 类组件&#xff0c;顾名思义&#xff0c;也就是通过使用ES6类的编写形式去编写组件&#xff0c;该类必须继承React.Component 如果想要访问父组件传递过来的参数&#xff0c;可通过this.props的方式去访问 在组件中必须实现render方法&#xff0c;在return中返回…

详解c++---类和对象(四)

这里写目录标题const成员再谈构造函数为什么会有初始化列表第一个问题第二个问题第三个问题初始化列表的使用方式即注意事项explicit关键字static成员static修饰类中的变量一些性质static修饰成员函数友元友元函数友元类内部类匿名对象拷贝对象时的一些编译器优化const成员 在…

【知识图谱】(task2)知识图谱表示

note 知识图谱的符号表示方法&#xff1a; 属性图是工业界最常见的图谱建模方法&#xff0c;属性图数据库充分利用图结构特点做了性能优化&#xff0c;实用度高&#xff0c;但不支持符号推理。RDF是W3C推动的语义数据交换标准与规范&#xff0c;有更严格的语义逻辑基础&#x…