Home Forums Hardware Using a 16×2 LCD

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • timmyjane
    Participant
    Post count: 3

    Anyone know how so set up for a 16×2 LCD instead of an 8×2? I am getting some strange characters that I cant figure out how to get rid of. Using “Hello World” the screen is fine. Its not as simple as lcd.begin(16, 2). The characters show once I leave the main dash then they stick around.

    carecon77
    Participant
    Post count: 11

    YES,

    ADD SOME BLANK SPACES BEFORE THE VALUES PARAMETERS IN THE SKETCH

    carecon77
    Participant
    Post count: 11

    Use these lines in your sketch

    lcd.print(highlight? ‘>’:’ ‘);
    switch(index)
    {
    case 0:
    lcd.print(F(“DashBrd “));
    break;
    case 1:
    lcd.print(F(“Config “));
    break;
    case 2:
    lcd.print(tuning ? F(“Cancel “) : F(“ATune “));
    break;
    case 3:
    if(runningProfile)lcd.print(F(“Cancel “));
    else lcd.print (profname);
    lcd.print (” “);
    break;
    default:
    return;
    }

    break;
    case TYPE_VAL:

    switch(index)
    {
    case 4:
    val = setpoint;
    dec=1;
    icon=’S’;
    break;
    case 5:
    val = input;
    dec=1;
    icon=’I’;
    canEdit=false;
    break;
    case 6:
    val = output;
    dec=1;
    icon=’O’;
    canEdit = (modeIndex==0);
    break;
    case 8:
    val = kp;
    dec=2;
    icon=’P’;
    break;
    case 9:
    val = ki;
    dec=2;
    icon=’I’;
    break ;
    case 10:
    val = kd;
    dec=2;
    icon=’D’;
    break ;

    default:
    return;
    }
    lcd.print(edit? ‘[‘ : (highlight ? (canEdit ? ‘>’:’|’) :
    ‘ ‘));

    if(isnan(val))
    { //display an error
    lcd.print(icon);
    lcd.print( now % 2000<1000 ? F(" Error"):F(" "));
    return;
    }

    for(int i=0;i buffer[0] = icon;
    isNeg = num<0;
    if(isNeg) num = 0 – num;
    didneg = false;
    decSpot = 6-dec;
    if(decSpot==6)decSpot=7;
    for(byte i=6; i>=1;i–)
    {
    if(i==decSpot)buffer = ‘.’;
    else {
    if(num==0)
    {
    if(i>=decSpot-1) buffer
    =’0′;
    else if (isNeg && !didneg)
    {
    buffer
    =’-‘;
    didneg=true;
    }
    else buffer
    =’ ‘;
    }
    else {
    buffer
    = num%10+48;
    num/=10;
    }
    }
    }
    lcd.print (” “);
    lcd.print (buffer);
    break;
    case TYPE_OPT:

    lcd.print(edit ? ‘[‘: (highlight? ‘>’:’ ‘));
    switch(index)
    {
    case 7:
    lcd.print(modeIndex==0 ? F(” M Man “):F(” M Auto “));
    break;
    case 11://12:

    lcd.print(ctrlDirection==0 ? F(“A Direc”):F(“A Rever”));
    break;
    }

    carecon77
    Participant
    Post count: 11

    shi$&#$!

    the posting took all my blank spaces

    example: lcd.print(F(“DashBrd********”))
    take all the * and put blank spaces instead.
    This will work. You have to remember the OSPID LCD show only 8 caracters, everything after that will not be showed, so the programer didn’t bother with the artifacts. Putting blank spaces after the words will put the artifacts after the 16 caracters, RESOLVING THE Artifact problem.

    timmyjane
    Participant
    Post count: 3

    Lol. Thanks for the effort. What about inside the dash. For example after the Sv temp ends I’ve got the artifacts.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.