Advertisement
microrobotics

W12956

Aug 30th, 2017
3,070
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.11 KB | None | 0 0
  1. #include <SPI.h>
  2. #include "EPD_drive.h"
  3. #include "EPD_drive_gpio.h"
  4. #include "Display_Lib.h"
  5.  
  6. WaveShare_EPD EPD = WaveShare_EPD();
  7. void setup() {
  8.   // put your setup code here, to run once:
  9.    pinMode(CS,OUTPUT);
  10.    pinMode(DC,OUTPUT);
  11.    pinMode(RST,OUTPUT);
  12.    pinMode(BUSY,INPUT);
  13.    
  14.   Serial.begin(115200);
  15.   SPI.beginTransaction(SPISettings(2000000, MSBFIRST, SPI_MODE0));
  16.   SPI.begin();
  17.  
  18.   Serial.println("------------Clear full screen-----------------");
  19.   EPD.Dis_Clear_full();
  20.  
  21.   //2.display init
  22.   EPD.EPD_init_Part();
  23.   driver_delay_xms(DELAYTIME);
  24.  
  25.   //Clear screen
  26.   Serial.println("--------------Clear part screen------------");
  27.   EPD.Dis_Clear_part();
  28.   driver_delay_xms(DELAYTIME);
  29.   //2.9inch paper is 296*122
  30.   //x max is 31 ,y max is
  31.   EPD.Dis_Drawing(31,0,(unsigned char *)Circle3232,32,32); //Circle
  32.   EPD.Dis_Drawing(0,0,(unsigned char *)Circle3232,32,32); //Line
  33.  
  34.   EPD.Dis_Drawing(0,12,(unsigned char *)Circle3232,32,32); //Line
  35.   EPD.Dis_Drawing(31,12,(unsigned char *)Circle3232,32,32); //Line
  36. }
  37.  
  38. void loop() {
  39.   // put your main code here, to run repeatedly:
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement