inicialización s5230
DESCRIPTION
Rutina inicializaciòn S5230TRANSCRIPT
Si se habla de algo que es de inicialización S5230 (aunque en BASIC, pero no importa)LCDINIT Sub ()'------------------------WR = 1Res = 0WaitMs (100)Res = 1WaitMs (100)CS = 0'------------------------SCLCD (y h11) 'Visualización de salida de la hibernación'SCLCD (y H29)' Activar DisplayWaitMs (100)'------------------------SCLCD (y h36) «orientación vertical de la pantallaSDLCD (y b10110100)'------------------------End Sub
¿Por qué equipo zaremiroval encender la pantalla - en primer lugar, hacer la inicialización, y luego borrar la pantalla y vuelva a encender. Aquí está una limpieza espiritual de la pantalla:ClsLCD Sub ()'------------------------SCLCD (y H2A) 'aorietatsii Equipo coordenadaSDLCD (H0) y 'coordenadas Dannyenachala Y (0)SDLCD (y h0) 'SDLCD (1) 'termina Coordenada de datos (400)SDLCD (y h90) ''------------------------SCLCD (y H2B) 'orietatsii Equipo de coordenada XSDLCD (y h0) 'Dannyenachala coordenada X (0)SDLCD (y h0) 'SDLCD (0) "fin de datos coordenada X (240)SDLCD (240) ''------------------------SCLCD (y H2C) 'récord del equipo en la memoria de la pantallaPara mn = 1 a 401Para nm = 1 a 241SDLCD (0) »SDLCD (0) »SDLCD (0) »SiguienteSiguienteEnd Sub
Oh sí, yo no he dicho que SDLCD - es una función de enviar un byte de datos en la pantalla, y SCLCD - byte de comando.Aquí están:
SCLCD Sub (dat As Byte) 'envío de comandosDC = 0PORTD = datWR = 0WR = 1End Sub
Sub SDLCD (dat As Byte) 'envío de datosDC = 1PORTD = datWR = 0WR = 1End Sub
Honestamente es simple como 3 kopeks
Aquí está el dibujo de un círculo. En algún lugar en Internet arrancó obras.Lx, Ly - coordenadas del centroR - radioLCD_pset (Px, Py, Color) - punto de dibujo subprograma coordina Px, Py.
LCD_Circle Procedimiento (Lx, Ly, R: Byte; Color: Word);Var D1, dx1, Dxy, Rx1, Ry1: Integer;Px, Py: Word;ComenzarRx1: = 0;Ry1: = Integer (R);D1: = 1 - Ry1;Dx1: = 3;Dxy: = -2 * Ry1;Dxy: = Dxy + 5;
Mientras Ry1> = Rx1 doComenzarPx: = Palabra (Integer (Lx) + Rx1); //p.x + XPy: = Palabra (Integer (Ly) + Ry1); //P.y + YLCD_pset (Px, Py, color);
Px: = Palabra (Integer (Lx) + Ry1); //p.x + YPy: = Palabra (Integer (Ly) + Rx1); //P.y + XLCD_pset (Px, Py, color);
Px: = Palabra (Integer (Lx) + Ry1); //P.x + YPy: = Palabra (Integer (Ly) - Rx1); //P.y -xLCD_pset (Px, Py, color);
Px: = Palabra (Integer (Lx) + Rx1); //P.x + XPy: = Palabra (Integer (Ly) - Ry1); //P.y -yLCD_pset (Px, Py, color);
Px: = Palabra (Integer (Lx) - Rx1); //P.x -xPy: = Palabra (Integer (Ly) - Ry1); //P.y -yLCD_pset (px, Py, color);
Px: = Palabra (Integer (Lx) - Ry1); //P.x -yPy: = Palabra (Integer (Ly) - Rx1); //P.y -xLCD_pset (Px, Py, color);
Px: = Palabra (Integer (Lx) - Ry1); //P.x -yPy: = Palabra (Integer (Ly) + Rx1); //P.y + XLCD_pset (Px, Py, color);
Px: = Palabra (Integer (Lx) - Rx1); //P.x -xPy: = Palabra (Integer (Ly) + Ry1); //P.y + YLCD_pset (Px, Py, color);
Si D1 <0 entoncescomenzarD1: = D1 + dx1;Dx1: = dx1 + 2;Dxy: = Dxy + 2;Inc (Rx1);finMáscomenzarD1: = D1 + Dxy;Dx1: = dx1 + 2;Dxy: = Dxy + 4;Inc (Rx1);Diciembre (Ry1);fin;Fin; // Mientras bucle desdeFin;