Hola:
hice un programa en mikrobasic que me muestra fecha y hora en un lcd de 16x2, la fecha la muestro en la linea 1
y la hora en la 2.
el problema es que me muestra en la linea 1 al final de la misma el comienzo de la linea 2(adjunto el pgm que creo que esta bien),
el error lo da en Proteus y en un protoboard tambien.
Cualquier ayuda se agradece
program Lcd_Test
dim csecs,secs, mins, hrs as byte ' tally variables
dim clk as string[12] ' output string for LCD
dim hstr as string[3]
dim mstr as string[3]
dim sstr as string[3]
dim csstr as string[3]
dim todosfecha as string[8]
dim dia,mes,ano as byte
dim diastr as string[3]
dim messtr as string[3]
dim anostr as string[2]
dim int_count as byte
dim text as string[16]
dim update as boolean
sub procedure Muestro_display(dim byref dia,mes,ano,hrs,mins,secs,csecs as byte,
dim byref diastr as string[3],
dim byref messtr as string[3],
dim byref anostr as string[2],
dim byref hstr as string[3],
dim byref mstr as string[3],
dim byref sstr as string[3],
dim byref csstr as string[3])
bytetostr(dia, diastr) ' create clock output string for LCD
If diastr[1] = 32 Then diastr[1] = 48 End If
bytetostr(mes, messtr)
messtr[0] = "/"
If messtr[1] = 32 Then messtr[1] = 48 End If
bytetostr(ano, anostr)
anostr[0] = "/"
If anostr[1] = 32 Then anostr[1] = 48 End If
bytetostr(hrs, hstr) ' create clock output string for LCD
If hstr[1] = 32 Then hstr[1] = 48 End If
bytetostr(mins, mstr)
mstr[0] = ":"
If mstr[1] = 32 Then mstr[1] = 48 End If
bytetostr(secs, sstr)
sstr[0] = ":"
If sstr[1] = 32 Then sstr[1] = 48 End If
bytetostr(csecs, csstr)
csstr[0] = ":"
If csstr[1] = 32 Then csstr[1] = 48 End If
Lcd_Out(1,1,diastr)
Lcd_Out(1,4,messtr)
Lcd_Out(1,7,anostr)
LCD_Out(2,2,hstr)
LCD_OUT(2,5,mstr)
LCD_OUT(2,8,sstr)
LCD_OUT(2,11,csstr)
end sub
main:
text = "mikroElektronika"
ADCON1 = 0x0F
int_count = 0
secs = 59
mins = 59
hrs = 23
dia=31
mes=12
ano=8
update = true
' Lcd_Config(PORTB,3,2,1,0,PORTB,4,7,5) ' Lcd_Init_EP5, see Autocomplete
Lcd_Config(PORTB,3,2,1,0,PORTB,4,7,5) ' Lcd_Init_EP5, see Autocomplete
LCD_Cmd(LCD_CLEAR) ' Clear display
LCD_Cmd(LCD_CURSOR_OFF) ' Turn cursor off
Delay_ms(500)
while true
Muestro_display(dia,mes,ano,hrs,mins,secs,csecs,diastr,messtr,anostr,hstr,mstr,sstr,csstr)
wend
end.