1 Star 0 Fork 0

DFRobot / DFRobot_ePaper

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

FireBeetle Covers-ePaper Display Module(SPI)

SVG1

FireBeetle Covers-ePaper Display Module(I2C)

SVG1

DFRobot_ePaper Library for Arduino

It provides an Arduino library to control 4 types of e-link display screen.
The library compromises 4 drive modes of two epapers, including IIC drive, SPI drive of both Black & White epaper and Tricolor epaper.

Table of Contents

Summary

The library is used to control Black & White epaper and Tricolor epaper screens to display graphics, images and text. And there are two drive modes to select.

Methods


/*!
 * @brief Select the corresponding pins -> tricolor epaper
 *
 * @param cs_W21  Select spi cs pin
 *     D3: Piece of selected pin
 *     D4: Piece of selected pin
 * @param cs_GT30  Select the word library chip cs pins
 *     D5: Piece of selected pin
 *     D6: Piece of selected pin
 * @param dc  Select spi dc pin
 *     D8: Piece of selected pin
 * @param busy  Select spi busy pin
 */
void begin(const char cs_W21, const char cs_GT30, const char dc, busy);

/*!
 * @brief Select the corresponding pins -> black and white epaper
 *
 * @param busy Select I2C busy pin
 */
void begin(const char busy);

/*!
 * @brief Refresh screen -> tricolor epaper
 */
void flush(void);

/*!
 * @brief Refresh screen -> black and white epaper
 *
 * @param mode  The refresh mode
 *     PART: Local refresh
 *     FULL: Global refresh
 */
void flush(uint8_t mode);

/*!
 * @brief Image display -> tricolor epaper
 *
 * @param pic_bw  Black and white part
 *        pic_red  The red part
 */
void drawPicture(const unsigned char *pic_bw, const unsigned char *pic_red);

/*!
 * @brief Image display -> black and white epaper
 *
 * @param pic  Black and white part
 */
void drawPicture(const unsigned char *pic);

/*!
 * @brief Display string
 *
 * @param (x,y)  coordinate
 *        size  The font size
 *        *ch  The string to display
 *        color  BLACK or WHITE or RED
 */
void disString(uint8_t x, uint8_t y, uint8_t size, char *ch, uint8_t color);

/*!
 * @brief fill screen
 */
void fillScreen(uint16_t color);

/*!
 * @brief draw a pixel
 *
 * @param x       x-axis coordinates
 *        y       y-axis coordinates
 */
void drawPixel(int16_t x, int16_t y, uint16_t color);

/*!
 * @brief draw a line
 *
 * @param x0        The x-axis of the starting point
 *        y0        The y-axis of the starting point
 *        x1        The x-axis of the terminal point
 *        y1        The y-axis of the terminal point
 */
void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, 
              uint16_t color);

/*!
 * @brief draw a horizontal line
 *
 * @param x         The x-axis of the starting point
 *        y         The y-axis of the starting point
 *        width     The line lenth
 */
void drawHLine(int16_t x, int16_t y, int16_t width, uint16_t color);

/*!
 * @brief draw a vertical line
 *
 * @param x         The x-axis of the starting point
 *        y         The y-axis of the starting point
 *        height    The line lenth
 */
void drawVLine(int16_t x, int16_t y, int16_t height, uint16_t color);

/*!
 * @brief draw a rectangle
 *
 * @param x         The x-axis of the starting point
 *        y         The y-axis of the starting point
 *        width     The rectangle width
 *        height    The rectangle height
 */
void drawRect(int16_t x, int16_t y, int16_t width, int16_t height, 
              uint16_t color);

/*!
 * @brief draw a fill rectangle
 *
 * @param x         The x-axis of the starting point
 *        y         The y-axis of the starting point
 *        width     The rectangle width
 *        height    The rectangle height
 */
void fillRect(int16_t x, int16_t y, int16_t width, int16_t height, 
              uint16_t color);

/*!
 * @brief draw a circle
 *
 * @param x         The x-axis of the center
 *        y         The y-axis of the center
 *        r         The circle radius 
 */
void drawCircle(int16_t x, int16_t y, int16_t r, uint16_t color);

/*!
 * @brief draw a fill circle
 *
 * @param x         The x-axis of the center
 *        y         The y-axis of the center
 *        r         The circle radius
 */
void fillCircle(int16_t x, int16_t y, int16_t r, uint16_t color);

/*!
 * @brief draw a triangle
 *
 * @param x0        The x-axis of the first point
 *        y0        The y-axis of the first point
 *        x1        The x-axis of the second point
 *        y1        The y-axis of the second point
 *        x2        The x-axis of the third point
 *        y2        The y-axis of the third point
 */
void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, 
                  int16_t x2, int16_t y2, uint16_t color);
                  
/*!
 * @brief draw a fill triangle
 *
 * @param x0        The x-axis of the first point
 *        y0        The y-axis of the first point
 *        x1        The x-axis of the second point
 *        y1        The y-axis of the second point
 *        x2        The x-axis of the third point
 *        y2        The y-axis of the third point
 */
void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, 
                  int16_t x2, int16_t y2, uint16_t color);

/*!
 * @brief draw a rounded rectangle
 *
 * @param x         The x-axis of the starting point
 *        y         The y-axis of the starting point
 *        width     The rectangle width
 *        height    The rectangle height
 *        r         The rounded corner radius
 */
void drawRoundRect(int16_t x, int16_t y, int16_t, width, int16_t height, 
                   int16_t r, uint16_t color);
                   
/*!
 * @brief draw a fill rounded rectangle
 *
 * @param x         The x-axis of the starting point
 *        y         The y-axis of the starting point
 *        width     The rectangle width
 *        height    The rectangle height
 *        r         The rounded corner radius
 */
void fillRoundRect(int16_t x, int16_t y, int16_t, width, int16_t height, 
                   int16_t r, uint16_t color);

Compatibility

FireBeetle Covers-ePaper Display Module(SPI):

MCU Work Well Work Wrong Untested Remarks
FireBeetle-ESP32
FireBeetle-ESP8266
FireBeetle-BLE4.1
Arduino uno
Arduino leonardo

FireBeetle Covers-ePaper Display Module(I2C):

MCU Work Well Work Wrong Untested Remarks
FireBeetle-ESP32 Picture fetching
FireBeetle-ESP8266
FireBeetle-BLE4.1 Select the "C" array
Arduino uno
Arduino leonardo

Depends

Projects URL Remarks
DFRobot_Display https://github.com/DFRobot/DFRobot_Display must

Tool

Picture fetching software USES tutorials

  • Note: You need an image conversion software. Download(lcd-image-converter)
                The image size of black and white epaper is 250×122.
                The image size of the tricolor epaper is 212×104.
  • 1. Open a picture“xxx.jpg”. File->Open
    image
  • 2. Set the image to flip. Image->Rotate->180
    image
  • 3. Open the output parameter Settings menu. Options->Conversion
    image
  • 4. Set the parameters as shown below.
    image
  • 5. After setting the parameters, click Show Preview.
    image
  • 6. Copy the binary in the dialog box to the array in the demo.
    image
  • 7. Then, download the program to your development board and the image will appear on the screen.

History

  • data 2017-12-01
  • version V0.1

Credits

Written by LiXin(1035868977@qq.com), 2017. (Welcome to our website)

空文件

简介

暂无描述 展开 收起
C++
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C++
1
https://gitee.com/dfrobot/DFRobot_ePaper.git
git@gitee.com:dfrobot/DFRobot_ePaper.git
dfrobot
DFRobot_ePaper
DFRobot_ePaper
master

搜索帮助

14c37bed 8189591 565d56ea 8189591