add: image
This commit is contained in:
76
frame/src/main.cpp
Normal file
76
frame/src/main.cpp
Normal file
@@ -0,0 +1,76 @@
|
||||
#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 x = 0; x < image.getWidth(); ++x)
|
||||
{
|
||||
image.at(x, 0) = 0xFF;
|
||||
}
|
||||
|
||||
display.Display(image);
|
||||
}
|
||||
|
||||
/*
|
||||
#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;
|
||||
}
|
||||
*/
|
||||
Reference in New Issue
Block a user