|
|
View previous topic :: View next topic |
Author |
Message |
soulraven
Joined: 08 Feb 2009 Posts: 72 Location: campulung muscel
|
help for the menu and interface |
Posted: Mon Feb 16, 2009 9:52 am |
|
|
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
|
|
Posted: Tue Mar 03, 2009 2:02 pm |
|
|
please help... |
|
|
andreluizeng
Joined: 04 Apr 2006 Posts: 117 Location: Brasil
|
|
Posted: Wed Mar 04, 2009 1:17 pm |
|
|
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
|
|
Posted: Wed Mar 04, 2009 1:35 pm |
|
|
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
|
|
Posted: Wed Mar 04, 2009 1:47 pm |
|
|
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
|
|
Posted: Wed Mar 04, 2009 1:58 pm |
|
|
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
|
|
Posted: Wed Mar 04, 2009 2:05 pm |
|
|
from where is coming the IR value ? a peripheral connected where ? _________________ Andre |
|
|
soulraven
Joined: 08 Feb 2009 Posts: 72 Location: campulung muscel
|
|
Posted: Wed Mar 04, 2009 2:07 pm |
|
|
i give up the idea for IR......i chose buttons.....3 buttons |
|
|
soulraven
Joined: 08 Feb 2009 Posts: 72 Location: campulung muscel
|
|
Posted: Sun Mar 08, 2009 4:27 am |
|
|
please I am new in this.... |
|
|
Sydney
Joined: 13 Feb 2009 Posts: 71
|
|
Posted: Sun Mar 08, 2009 8:04 am |
|
|
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
|
|
Posted: Sun Mar 08, 2009 11:44 am |
|
|
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 |
|
|
|
|
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
|