Thread: PIC16F684 Interfacing with Hitachi 44780

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #13
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    I think this should answer your first question. I'll take a longer look at the second part soon (if nobody else beats me to it).
    We've tried

    Code:

    int noofsteps = 35;

    char TopMessage[]
    char BotMessage[] = " Hear me roar "
    sprintf(TopMessage, "%d", noofsteps);

    But depending on the combination of "'s, ;s and )s we just get %d displayed on the screen, or the compiler fails to build as we're changing variable type from integer to character.
    If you don't specify a size for TopMessage, and don't provide an initializer, it defaults to size 1. Your also missing a couple semicolons. Try this:
    Code:
    char TopMessage[11];
    char BotMessage[] = "  Hear me roar  ";
    sprintf(TopMessage, "%d", noofsteps);
    Last edited by anduril462; 12-03-2010 at 01:42 PM. Reason: Removed stupid mistake

Popular pages Recent additions subscribe to a feed