Files
Frame/frame/src/main.cpp
2022-03-02 23:54:26 +01:00

93 lines
1.6 KiB
C++

#include <chrono>
#include <iostream>
#include <thread>
#include <vector>
using namespace std::chrono_literals;
#include "display/EPD_7in5_V2.hpp"
int main()
{
frame::display::EPD_7in5_V2 display{};
display.Init();
display.Clear(frame::display::Color::BLACK);
std::this_thread::sleep_for(2s);
display.Clear(frame::display::Color::WHITE);
std::this_thread::sleep_for(2s);
frame::Image image(display.getSize());
for(int y = 0; y < 1; ++y)
{
for(int x = 0; x < image.getWidth(); ++x)
{
image.at(x, y) = 0xFF;
}
}
for(int y = image.getHeight() - 1; y < image.getHeight(); ++y)
{
for(int x = 0; x < image.getWidth(); ++x)
{
image.at(x, y) = 0xFF;
}
}
display.Display(image);
std::this_thread::sleep_for(10s);
display.Clear(frame::display::Color::WHITE);
}
/*
#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;
}
*/