CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

help for the menu and interface

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
soulraven



Joined: 08 Feb 2009
Posts: 72
Location: campulung muscel

View user's profile Send private message Send e-mail Yahoo Messenger

help for the menu and interface
PostPosted: Mon Feb 16, 2009 9:52 am     Reply with quote

hi,
I want to do an interface and a menu for a personal project, I also presented by the forum.

Interface, it's about ready
menu but it does not know what to do because I want to order from an infrared remote.

Menu want to include the following:
- Temp On ELV
<- +30- ->

Temp Stop ELV
<- +40- ->

<- +30- ->

EXIT
*

How do I make this menu, and be ordered and infrared sensor?.
soulraven



Joined: 08 Feb 2009
Posts: 72
Location: campulung muscel

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Tue Mar 03, 2009 2:02 pm     Reply with quote

please help...
andreluizeng



Joined: 04 Apr 2006
Posts: 117
Location: Brasil

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Wed Mar 04, 2009 1:17 pm     Reply with quote

soulraven

where will you display this menu ? LCD ?

there are a lot of way to implement that, one way could look like:
Code:


char Option;  // you can load a value here from where wherever you want.
do
{
   switch (Option)
  {
      case TEMP_ON: function_To_print_whatever_youwant ();
                                   break;
      case TEMP_STOP: same_thing ();
                                  break;     
  }

} while (TRUE);


the issue is:

you always need to refresh your display to show your new values.


in function_to_print_whatever_you_want ()

you have to read the value that you want (from interrupts, rs232, spi, i2c, whatever)
update the string and then display it.

good luck

regards.
_________________
Andre
soulraven



Joined: 08 Feb 2009
Posts: 72
Location: campulung muscel

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Wed Mar 04, 2009 1:35 pm     Reply with quote

a menu is displayed on a 16x2 LCD.
I chose to order the buttons
<*>
where * is
- Entry in the menu
- Exit menu
- Scrolling through the menu
<-> Select value stored in EEPROM

I can help with explanations of how to implement a solution too? are beginner in programming and microcontrollers
project is for a car of minicomputer
andreluizeng



Joined: 04 Apr 2006
Posts: 117
Location: Brasil

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Wed Mar 04, 2009 1:47 pm     Reply with quote

Soulraven,

Is better you try to make in our own way and post here the problems that you going to have. Then we can help you, but you need to write some code, making at least something appears in your lcd screen.

regards.
_________________
Andre
soulraven



Joined: 08 Feb 2009
Posts: 72
Location: campulung muscel

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Wed Mar 04, 2009 1:58 pm     Reply with quote

Code:
void front_display()
{
   lcd_gotoxy(1,1);
   printf(lcd_putc,"Apa:");
   lcd_gotoxy(6, 1); 
//   lcd_putc(223);
   lcd_gotoxy(11,1);
    printf(lcd_putc,"In:");
//   lcd_putc(223);     
 
   lcd_gotoxy(1,2);
   printf(lcd_putc,"Ulei:");
   //lcd_putc(223);
   lcd_gotoxy(10,2);
   printf(lcd_putc, "Out:");
//   lcd_putc(223);
}

void front_display2()
{
   lcd_gotoxy(1,1);
   printf(lcd_putc,"Rpm:");
   lcd_gotoxy(6,1); 
   lcd_gotoxy(10,1);
    printf(lcd_putc,"Gaz:");     
   lcd_gotoxy(1,2);
   printf(lcd_putc,"Bat:");
   lcd_gotoxy(10,2);
   printf(lcd_putc, "Rez:");

}

void start_elv()
{
lcd_gotoxy(1,1);
printf(lcd_putc,"Temp spam ELV");
lcd_gotoxy(1,2);
printf(lcd_putc,"<-");
lcd_gotoxy(7,2);
printf(lcd_putc,"+");
lcd_gotoxy(8,2);
printf(lcd_putc,"30");
lcd_gotoxy(10,2);
printf(lcd_putc,"-");
lcd_gotoxy(15,2);
printf(lcd_putc,"->");

}

void stop_elv()
{
lcd_gotoxy(1,1);
printf(lcd_putc,"Temp Oprire ELV");
lcd_gotoxy(1,2);
printf(lcd_putc,"<-");
lcd_gotoxy(7,2);
printf(lcd_putc,"+");
lcd_gotoxy(8,2);
printf(lcd_putc,"30");
lcd_gotoxy(10,2);
printf(lcd_putc,"-");
lcd_gotoxy(15,2);
printf(lcd_putc,"->");
}

void dimmer_plafoniera()
{
lcd_gotoxy(2,1);
printf(lcd_putc,"DIMMER PLAFON");
lcd_gotoxy(1,2);
printf(lcd_putc,"<-");
lcd_gotoxy(7,2);
printf(lcd_putc,"+");
lcd_gotoxy(8,2);
printf(lcd_putc,"30");
lcd_gotoxy(10,2);
printf(lcd_putc,"-");
lcd_gotoxy(15,2);
printf(lcd_putc,"->");
}

void exit()
{
lcd_gotoxy(7,1);
printf(lcd_putc,"EXIT");
lcd_gotoxy(8,2);
printf(lcd_putc,"*");

}


the code for the menu and interface is above.
the first two front_display() and front_display()2 , is the principal interface
and the rest is the menu.
i need to save some data in eeprom, data from Temp spam ELV and Temp Oprire ELV
andreluizeng



Joined: 04 Apr 2006
Posts: 117
Location: Brasil

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Wed Mar 04, 2009 2:05 pm     Reply with quote

from where is coming the IR value ? a peripheral connected where ?
_________________
Andre
soulraven



Joined: 08 Feb 2009
Posts: 72
Location: campulung muscel

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Wed Mar 04, 2009 2:07 pm     Reply with quote

i give up the idea for IR......i chose buttons.....3 buttons
soulraven



Joined: 08 Feb 2009
Posts: 72
Location: campulung muscel

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Sun Mar 08, 2009 4:27 am     Reply with quote

please I am new in this....
Sydney



Joined: 13 Feb 2009
Posts: 71

View user's profile Send private message

PostPosted: Sun Mar 08, 2009 8:04 am     Reply with quote

Then you have chosen a rather large project for your first one, no offence but the code you have does almost nothing, noone is going to write the application for you, do some research on state machines. The function of the buttons will be decided by the state machine, button presses will change the state, or alter values, and what is displayed will be decided by the state machine. It may seem complicated to begin with, but in fact they are quite simple to program, here is a simple example http://en.wikipedia.org/wiki/Event_driven_finite_state_machine
andreluizeng



Joined: 04 Apr 2006
Posts: 117
Location: Brasil

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Sun Mar 08, 2009 11:44 am     Reply with quote

Sydney is right,

I didnt reply your last msg because I have a lot to work to do either, and all that we can do here is help someone that is having problem with their codes... but write a new code is out of the question...


regards..
_________________
Andre
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group