add: waveshare lib

This commit is contained in:
2022-02-12 21:24:50 +01:00
parent 183e9cf80c
commit afc4244f9d
10 changed files with 931 additions and 4 deletions

View File

@@ -1,7 +1,47 @@
#include <iostream>
#include <chrono>
#include <thread>
#include <vector>
using namespace std::chrono_literals;
#include <EPD_7in5_V2.h>
int main()
{
std::cout << "Hallo Welt" << std::endl;
EPD_7IN5_V2_Init();
EPD_7IN5_V2_ClearBlack();
std::this_thread::sleep_for(2s);
EPD_7IN5_V2_Clear();
std::this_thread::sleep_for(2s);
std::vector<uint8_t> image;
image.resize(EPD_7IN5_V2_HEIGHT * EPD_7IN5_V2_WIDTH);
uint8_t color = 0;
for(int x = 0; x < EPD_7IN5_V2_WIDTH; ++x)
{
for(int y = 0; y < EPD_7IN5_V2_HEIGHT; ++y)
{
image[EPD_7IN5_V2_WIDTH * y + x] = color;
}
color = ~color;
}
EPD_7IN5_V2_Display(image.data());
std::this_thread::sleep_for(10s);
EPD_7IN5_V2_Clear();
EPD_7IN5_V2_Sleep();
return 0;
}