E
Elnegm
Guest
Czy ktoś ma algorytm na wyciąganie linii agraphical LCD 128x64 Ampire z sterownikiem KS0108? Z góry dzięki
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
DrawLine3 void (int x1, int y1, int x2, int y2, boolean kolor) {int i, deltax, deltay, numpixels, int d, dinc1, dinc2, int x, xinc1, xinc2, int y, yinc1, yinc2 / / obliczenia deltaX i deltaY deltax = abs (x2 - x1); deltay = abs (y2 - y1) / / inicjalizacja if (deltax> = deltay) {/ / Jeśli x jest zmienną niezależną numpixels = deltax + 1; d = (2 * deltay) - deltax; dinc1 deltay =
/ / Cel: Rysowanie linii na graficzny LCD za pomocą Bresenhama's / / line algorytmu rysunek / Wejścia: (x1, y1) - rozpoczęcie koordynować / / (x2, y2) - koniec koordynować / / kolor - ON lub OFF / / Zależności: glcd_pixel () glcd_line void (int x1, int y1, int x2, int y2, INT1 kolor) {int podpisane x, y, firma Addx, addy, dx, dy, podpisali długo P; int i; dx = abs ((podpisane int) (x2 - x1)); dy = abs ((podpisane int) (y2 - y1)), x = x1, y = y1; if (x1> x2) firma Addx = -1, inaczej firma Addx = 1; if (y1> y2) addy = -1; jeszcze addy = 1; if (dx> = dy) {P = 2 * dy - dx; for (i = 0; i