#include #include #include #include //Adafruit_SSD1306 display1(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); Adafruit_SSD1306 display2(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire1, -1); void initDisplay() { /*Wire.begin(D1_I2C_SDA, D1_I2C_SCL); if(!display1.begin(SSD1306_EXTERNALVCC, DISPLAY_I2C_ADDRESS)) { Serial.println("SSD1306 #1 allocation failed"); for(;;); }*/ Wire1.begin(D2_I2C_SDA, D2_I2C_SCL); if(!display2.begin(SSD1306_SWITCHCAPVCC, DISPLAY_I2C_ADDRESS)) { Serial.println("SSD1306 #2 allocation failed"); for(;;); } //display1.clearDisplay(); //Serial.println("start display 2"); //заливаем весь дисплей /*display2.clearDisplay(); for (int x = 0; x < 128; x ++) { for (int y = 0; y < 64; y++) { display2.drawPixel(x, y, SSD1306_WHITE); } }*/ //default huynnya display2.clearDisplay(); //display2BorderDebug(); display2Border(); display2DrawSenseLine(3.5); display2.display(); //Serial.println("start display 2 test success"); } void drawPoint(int displayId, int x, int y) { //float rad = y * PI / 180.0; switch (displayId) { case 1: break; case 2: display2.clearDisplay(); display2Border(); display2DrawSenseLine(map(x, 0, 10, 90, -90)); display2.display(); break; default: break; } } const int16_t borders[][2] = { {20, 59}, {20, 30}, {29, 15}, {40, 3}, {45, 1}, {65, 0}, {80, 1}, {91, 3}, {103, 15}, {110, 30}, {110, 59} }; const int borderSize = sizeof(borders) / sizeof(borders[0]); void display2BorderDebug() { int x = 0; int y = 1; for (int i = 1; i