goule Posted June 19, 2007 Report Share Posted June 19, 2007 Hi all,I'd like to have some realtime messages (+ why not char animations) appear briefly on the screen, so that when they dissapear, the content that was initially displayed on the screen (overwritten by the message) gets back. So I had the idea to develop some kind of "generic" function that would do MIOS_LCD_CursorSet + MIOS_LCD_PrintCString + eventually MIOS_LCD_PrintBCD3 for instance if an int is also passed as a parameter, well you got the idea ;)In the meanwhile, this function could store a copy of what's been written on the screen (typically a screen dump), so that it can easily refresh original screen when I want to get rid properly of that realtime messages. The problem is it seems impossible to do this without the use of string functions + other C functions (like itoa to display the number).Does any of you already worked on that subject ? Quote Link to comment Share on other sites More sharing options...
audiocommander Posted June 19, 2007 Report Share Posted June 19, 2007 you can simply use [tt]MIOS_LCD_MessageStart()[/tt];)Cheers,Michael Quote Link to comment Share on other sites More sharing options...
goule Posted June 19, 2007 Author Report Share Posted June 19, 2007 Hey why not :D ;D but I could never understand the meaning of that function ... ::)Tried it a few times but could never get the written msg to dissapear ... ???+ what's the use of MessageStop() ?Does that code has to be in a specific location within code lines ?Thanks anyway I'll give it a try asap ! 8) Quote Link to comment Share on other sites More sharing options...
goule Posted June 19, 2007 Author Report Share Posted June 19, 2007 Okay, I've tested the function a little deeper than the last time ;)As far as I can see, I've two remarks :- You must have the entire LCD content written previously (I mean over every single location on the LCD), otherwise the chars generated with MessageStart( ) will not dissapear ???- If you try to deal with counters & cycles to have a nice animation (lets say I want to have an animated worm running on the screen ;D (good old times)) I can't say for instance "MIOS_LCD_MessageStart(50);" for each char because it doesn't care about your counters : all the chars vanish at the same time ... (but perhaps have I done something wrong ?)What's the use of MessageStop( ) ?Thank you guys Quote Link to comment Share on other sites More sharing options...
audiocommander Posted June 19, 2007 Report Share Posted June 19, 2007 Hi Olivier,I just noticed that the description in the function overview is a bit misleading.in principle it's very (very) simple:You should call this code not from within the LCD_Tick() routine, but from somewhere else - though of course you can call it from LCD_Tick(), but the point is:MIOS_LCD_Message_Start() does nothing but preventing MIOS_LCD_Tick() from being called for the given amount of time.So the use of MessageStop() gets pretty clear; you can immediately abort the message if the delay is still active, so that Tick() is going to be called again. In both cases MIOS_LCD_Init() is called before continuing the Ticks.As I said, very simple:MIOS_LCD_MessageStartC_DECLARATION void MIOS_LCD_MessageStart(unsigned char delay)DESCRIPTION a replacement for MIOS_LCD_PrintMessage which allows to start a message without calling "MIOS_LCD_PrintString"C_IN message delay in <delay>C_OUT -C_EXAMPLE // print message on LCD for 2 seconds MIOS_LCD_CursorSet(0x00 + 0); MIOS_LCD_PrintCString("Pot value: "); MIOS_LCD_PrintHex2(MIOS_AIN_Pin7bitGet(0)); MIOS_LCD_MessageStart(255);So, it would help you in the question you asked first, cause you don't need to care about what was previously on the screen.By using the delay within a custom timer routine, I think there should also be nice (simple) animations possible. But remember that you have to use your own timer, 'cause StartMessage prevents the LCD_Tick() routine ;)Cheers,Michael Quote Link to comment Share on other sites More sharing options...
goule Posted June 20, 2007 Author Report Share Posted June 20, 2007 Thank you for that clear explanations !! ;D 8)Now it's my turn to play :DSee you guyz Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.