Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5991765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:26:05+00:00 2026-05-22T23:26:05+00:00

I’m working on a project implementing a clock using PIC18, LCD, … etc and

  • 0

I’m working on a project implementing a clock using PIC18, LCD, … etc and I am using mikroC to implement this project.

However, I am not good at C and I am stuck at certain point. The clock has a menu with several options that will enable the user to set time, alarms, alarm sound, etc. The menu has the following:

1. Set Time
2. Add Alarm
3. Select Alarm
4. Add New Tone
5. Select Tone
6. EXIT

The clock has 3 pushbuttons, OK,RIGHT, and LEFT. When the clock power-on, it will show Set Time on LCD as default. I want to add a feature that when I press RIGHT pushbutton it should show Add Alarm but gradually not directly. I have 6 items in the menu so I have to do this gradually movement 12 times (6 for right and 6 for left). I have tried this as follows:

 Lcd_Out(2, 2, "   set Time   ");
 Delay_ms(50);
 Lcd_Out(2, 2, "  set Time    ");
 Delay_ms(50);
 Lcd_Out(2, 2, " set Time     ");
 Delay_ms(50);
 Lcd_Out(2, 2, " et Time      ");
 Delay_ms(50);
 Lcd_Out(2, 2, " t Time       ");
 Delay_ms(50);
 Lcd_Out(2, 2, " Time         ");
 Delay_ms(50);
 Lcd_Out(2, 2, " ime          ");
 Delay_ms(50);
 Lcd_Out(2, 2, " me           ");
 Delay_ms(50);
 Lcd_Out(2, 2, " e            ");
 Delay_ms(50);
 Lcd_Out(2, 2, "              ");
 Delay_ms(50);
 Lcd_Out(2, 2, "              ");
 Delay_ms(50);
 Lcd_Out(2, 2, "              ");
 Delay_ms(50);
 Lcd_Out(2, 2, "              ");
 Delay_ms(50);
 Lcd_Out(2, 2, "            A ");
 Delay_ms(50);
 Lcd_Out(2, 2, "           Ad ");
 Delay_ms(50);
 Lcd_Out(2, 2, "          Add ");
 Delay_ms(50);
 Lcd_Out(2, 2, "         Add  ");
 Delay_ms(50);
 Lcd_Out(2, 2, "        Add A ");
 Delay_ms(50);
 Lcd_Out(2, 2, "       Add Al ");
 Delay_ms(50);
 Lcd_Out(2, 2, "      Add Ala ");
 Delay_ms(50);
 Lcd_Out(2, 2, "     Add Alar ");
 Delay_ms(50);
 Lcd_Out(2, 2, "    Add Alarm ");
 Delay_ms(50);
 Lcd_Out(2, 2, "   Add Alarm  ");
 Delay_ms(50);
 Lcd_Out(2, 2, "  Add Alarm   ");

This was one movement and to do the others I need large code while the RAM of the PIC is limited. So, Can you guys help me solving this issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:26:06+00:00Added an answer on May 22, 2026 at 11:26 pm

    Here a variation avoiding all the memcpy, str*cpy orgy.

    #define STRSZ 14
    
    char str[STRZ*2+1] = "   set Time     Add Alarm   ";  /* The buffer must be writable */
    
    for (i = 0; i <= STR_SZ; i++) {            // Loop
      char save_ch = str[i + STRZ];            // Save the character at the end 
      str[i + STRZ] = 0;                       // Terminate the string
      Lcd_Out (2, 2, str + i);                 
      str[i + STRZ] = save_ch;                 // Restore buffer
      Delay_ms (50);
    }
    

    EDIT: shift to right

    for (i = STR_SZ; i >= 0; i--) {            // Loop
      char save_ch = str[i + STRZ];            // Save the character at the end 
      str[i + STRZ] = 0;                       // Terminate the string
      Lcd_Out (2, 2, str + i);                 
      str[i + STRZ] = save_ch;                 // Restore buffer
      Delay_ms (50);
    }
    

    On very small devices, avoiding unnecessary memory moves can be crucial

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm making a simple page using Google Maps API 3. My first. One marker
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.