ThingPulse / esp8266-oled-ssd1306

Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
https://thingpulse.com
Other
2.03k stars 643 forks source link

hi! i need help HeaderOverlay #172

Closed timurufa86 closed 4 years ago

timurufa86 commented 6 years ago

` void drawHeaderOverlay(OLEDDisplay display, OLEDDisplayUiState state ) {

display->setColor(WHITE); showProcesses(); display->drawHorizontalLine(0, 14, 128); //горизонтальная линия }

//____ icon disp____

void printpr(byte processNumber, byte poz) { switch (processNumber) { case 1: display.drawXbm(13, poz, Xbm1_width, Xbm1_height, Xbm1_bits); break; case 2: // display->drawXbm(13, y + poz, Xbm2_width, Xbm2_height, Xbm2_bits); break; case 3: // display->drawXbm(13, y + poz, Xbm3_width, Xbm3_height, Xbm3_bits); break; } } bool addProcess(byte processNumber) // добавление отображения процесса на экран { // есть ли у нас ещё свободные места? if (emptySlot >= MAX_PROCESSES) return false;

// проверяем - не существует ли такой процесс уже? for (byte i = 0; i < emptySlot; i++) { if (processes[i] == processNumber) return false; }

// добавляем processes[emptySlot] = processNumber;

emptySlot++;

return true; }

void removeProcess(byte processNumber) // удаление процесса с экрана { for (byte i = 0; i < emptySlot; i++) { if (processes[i] == processNumber) { for (byte k = i + 1; k < MAX_PROCESSES; k++) { processes[k - 1] = processes[k]; } emptySlot--;

  break;
}

} }

void showProcesses() { if (!emptySlot) return;

for (byte i = 0; i < emptySlot; i++) { printpr(processes[i], 112 - (i * 16)); // обратный порядок processes[emptySlot-i-1] } } void stmaster(bool st, byte num) //обработчик входящих статусов { if (st == 1) { addProcess(num); } else if (st == 0) { removeProcess(num); } showProcesses(); } ` The idea the following. there is an area at the top of the screen where I want to display the status icons of different processes in both cell phone... I need depending on the running processes display. Am I thinking right????

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.