It is currently Mon May 20, 2013 5:58 am
       


All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Mega128 LCD geeft geen tekst weer
PostPosted: Sat Nov 19, 2011 2:33 pm 
Offline
arexx.com user

Joined: Thu Aug 25, 2011 7:08 pm
Posts: 9
Location: Wijk bij Duurstede, NL
Beste Support,

Ik heb inmiddels dus een RP6 robot en deze uitgebreid met een mega128 expansion en een Pro unit mega 128.
Nu doet deze het prima, ik kan er zo'n beetje alles mee doen, maar als ik probeer tekst te weergeven op de display weigert deze van alle kanten.
Ik krijg alleen blokken te zien, nu heb ik al geprobeerd met de potentiometer dit bij te stellen, maar dit heeft geen zin.
Wat doe ik fout?

Op dit moment doet hij zelfs niks met bijgeleverde voorbeeld van LCD:
Code:
// LCD_1: decimal counter 0-9999
// used libraries: IntFunc_Lib.cc, LCD_Lib.cc

// a counter from 0-9999 is displayed on the LCD


//------------------------------------------------------------------------------
// generate a 4 digit counter
//
void LCD_Counter(word DLY)
{
    byte n0,n1,n2,n3;                       // variables for 4 counter postions

    LCD_Init();                             // init Display
    LCD_ClearLCD();                         // clear Display
    LCD_CursorOff();                        // turn Display Cursor off

    for (n3=0; n3<10; n3++)
    {
        for (n2=0; n2<10; n2++)
        {
            for (n1=0; n1<10; n1++)
            {
                for (n0=0; n0<10; n0++)
                {
                    LCD_CursorPos(7);       // set Cursor to position 7
                    LCD_WriteChar('0'+n0);  // displays ASCII '0' + n0
                    LCD_CursorPos(6);       // set Cursor to position 6
                    LCD_WriteChar('0'+n1);  // displays ASCII '0' + n1
                    LCD_CursorPos(5);       // set Cursor to position 5
                    LCD_WriteChar('0'+n2);  // displays ASCII '0' + n2
                    LCD_CursorPos(4);       // set Cursor to position 4
                    LCD_WriteChar('0'+n3);  // displays ASCII '0' + n3
                    AbsDelay(DLY);          // delay DLY ms
                }
            }
        }
    }
}

//------------------------------------------------------------------------------
// main program
//
void main(void)
{
    word TimeBase;
    TimeBase=200;                           // delay 200ms

    while (1)
    {
        LCD_Counter(TimeBase);              // function call with delay parameter
    }
}


Top
 Profile E-mail  
 
 Post subject: Re: Mega128 LCD geeft geen tekst weer
PostPosted: Sat Nov 19, 2011 4:05 pm 
Offline
Administrator
User avatar

Joined: Fri Mar 25, 2005 6:19 pm
Posts: 1378
Location: NRW
Hello,

blocks means Display is not initialized correctly.
Do you use the latest Example programs?

http://arexx.com/rp6/html/de/soft_doc_ccpro.htm
http://arexx.com/rp6/downloads/RP6_CCPR ... 090131.zip

the ones from the CD had too short delays for some LCD models,
but this was fixed a long time ago already.

Oh and you only need to initialize the LCD ONE single time.
You do it everytime you call your LCD Counter function.

You MUST call RP6_CCPRO_Init() at the start (or if you don't want to press the start button, copy the code from there into your own init function)

Auto Google translate:
Quote:
blokken betekent Display is niet correct geinitialiseerd.
Maakt u gebruik van het meest recente voorbeeld programma's?

http://arexx.com/rp6/html/de/soft_doc_ccpro.htm
http://arexx.com/rp6/downloads/RP6_CCPR ... 090131.zip

degenen die vanaf de cd te kort vertragingen had voor een aantal lcd-modellen,
maar dit was een lange tijd geleden al vast.

Oh en je hoeft alleen het LCD-scherm enkele keer te initialiseren.
Je doet het elke keer belt u uw LCD-Counter functie.

Je MOET bellen RP6_CCPRO_Init () aan het begin (of als je niet wilt op de startknop drukt, wordt de code kopiëren van daaruit naar je eigen init-functie)



Best Regards,
SlyD


Top
 Profile E-mail  
 
 Post subject: Re: Mega128 LCD geeft geen tekst weer
PostPosted: Sat Nov 19, 2011 4:11 pm 
Offline
arexx.com user

Joined: Thu Aug 25, 2011 7:08 pm
Posts: 9
Location: Wijk bij Duurstede, NL
Thanks SlyD, the examples I used were outdated, with the new examples it worked fine!
I only looked on the site with the english language and they were on the german language, how stupid of me!

_________________
What you don't know now, you may acquire it tomorrow!


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group