Results 1 to 5 of 5

Thread: [MuIn LCD] problem with clear screen or move cursor with last firmware

  1. #1

    [MuIn LCD] problem with clear screen or move cursor with last firmware

    Hi,

    there is a problem with command move cursor on arduino mega 2560.

    in the section loop i do:

    clear screen
    move cursor to line 3
    and print 20 caractere in the line3

    problem => cursor position is after un moment line1, after line 3, after line 1 etc..

    may be is a timing problem with move cursor or clear screen because command clear screen position a cursor in line 1, but i have tested whithout clear command only movecursor and the cursor position is line 1,2,3,4 after a moment.

    Where is a problem?

    video http://www.youtube.com/watch?v=3-csbGejOuY

    the code:

    Code:
    
    int i;
    
    void setup()
    {
      Serial2.begin(57600); 
    }
    
    void loop()
    {
       clear();
       move(3,1);
       for (i = 0; i < 20; i++)
       {
         printchar(4);
         delay(40); 
       }
       
    }
    
    void changeBaud()
    {
      Serial2.write(0xFE);
      Serial2.write(0x39);
      Serial2.write(0x01); 
      delay(3);
    }
    
    void clear()
    {
      Serial2.write(0xFE);
      Serial2.write(0x58);
      delay(3);
    }
    
    void graphinit()
    {
      Serial2.write(0xFE);
      Serial2.write(0x68);
      delay(3);
    }
    
    void bargraph(byte col, byte row, byte dir, byte length)
    {
      Serial2.write(0xFE);
      Serial2.write(0x7C);
      Serial2.write(col);
      Serial2.write(row);
      Serial2.write(dir);
      Serial2.write(length);
      delay(3);
    }
    
    void printmsg(char *msg)
    {
      Serial2.print(msg); 
    }
    
    void printchar(char c)
    {
      Serial2.print(c);
    }
    
    void move(byte row, byte col)
    {
      Serial2.write(0xFE);
      Serial2.write(0x47);
      Serial2.write(row); 
      Serial2.write(col);
      delay(3);
    }
    Last edited by andromeda; 05-12-10 at 12:58.

  2. #2
    I'm trying your code on Arduino 2009, let you know as soon as possible because you get this problem.

    Bye

  3. #3
    i have tested from other code for arduino and movecursor have problem, the parmaters from cursor move are bad when i want to put it at row or col to lcd.

  4. #4
    attached the update to version 2.2.4 of the firmware.



    I did the test with this sketch, is a bit more complex.
    Code:
     
    void setup()
    {
      Serial.begin(19200); 
    }
    int i;
    void loop()
    {
       clear();
       for (i = 1; i < 101; i++)
       {
         bargraph(1,4,0,i);
         move(3,i/5);
         if(i>5) printchar(4);
         move(2,10);
         Serial.print(i);
         move(1,5);
         Serial.print(i);
         move(1,15);
         Serial.print(i);
         delay(5); 
       }
    }
    void changeBaud()
    {
      Serial.write(0xFE);
      Serial.write(0x39);
      Serial.write(0x01); 
      delay(3);
    }
    void clear()
    {
      Serial.write(0xFE);
      Serial.write(0x58);
      delay(5);
    }
    void graphinit()
    {
      Serial.write(0xFE);
      Serial.write(0x68);
      delay(3);
    }
    void bargraph(byte col, byte row, byte dir, byte length)
    {
      Serial.write(0xFE);
      Serial.write(0x7C);
      Serial.write(col);
      Serial.write(row);
      Serial.write(dir);
      Serial.write(length);
      delay(5);
    }
    void printmsg(char *msg)
    {
      Serial.print(msg); 
    }
    void printchar(char c)
    {
      Serial.print(c);
    }
    void move(byte row, byte col)
    {
      Serial.write(0xFE);
      Serial.write(0x47);
      Serial.write(row); 
      Serial.write(col);
      delay(3);
    }
    Attached Files Attached Files

  5. #5
    Yes, thank you is ok, graph work and move cursor work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •