Clear Display
Clear display writes space code 20H (character pattern for character code 20H must be a blank pattern)
into all DDRAM addresses. It then sets DDRAM address 0 into the address counter, and returns the
display to its original status if it was shifted. In other words, the display disappears and the cursor or
blinking goes to the left edge of the display (in the first line if 2 lines are displayed). It also sets I/D to 1
(increment mode) in entry mode. S of entry mode does not change.
Return Home
Return home sets DDRAM address 0 into the address counter, and returns the display to its original status
if it was shifted. The DDRAM contents do not change.
The cursor or blinking go to the left edge of the display (in the first line if 2 lines are displayed).
Den både tömmer displayen och nollar pekaren med "clear display"
Där har du felet.
Endeså skickar du right kommandot innan du skriver ut gubben, hur många right du skall skicka får bestämmas utav ännu en variabel som ökar varje gång du kör loopen.
Eller så får du skippa o nolla den o backa tillbaka 2 steg och skriva en tom ruta o sen din gubbe.
Ett hett tips är att kolla på hur man addresserar pekaren utan att hålla på o hoppa fram o tillbaka. Det är grymmt smidigt när man väl vet hur.
Jag fattade 0 utav texten i databladet o satte mig istället o labba fram hur adresseringen funka.
På så sätt kan man nolla displayen och sedan i ett kommando få den att ställa sig i mitten på nedre raden tex.