![]() | ![]() | ![]() |
| | #91 |
|
This is my new temperature code: Code: for(tmp=0;tmp<5;tmp++){
ADCON0bits.GO = 1; //Start the conversion
while(ADCON0bits.DONE); //Wait until it’s done
result = ADRESH; //Load ADRESH into result
result <<= 8; //Shift over Result 8 bits to the left
result |= ADRESL; //OR in our LOW byte to finish off out INT
avg[tmp] = result;
if(KeyPORT == MENU) MainMenu();
DelayMS(40);
}
result = 0;
for(tmp=0;tmp<5;tmp++){
result += avg[tmp];
}
result /= 5;
if(result==oldresult) goto tSame;
DegC = (result*5)/10;
DegC--;
DegF = DegC * 9;
DegF/=5;
DegF+=32;
//clear LCD temp buffer
if(KeyPORT == MENU) MainMenu();
for(tmp=0;tmp<16;tmp++)
lcdtmp[tmp] = ' ';
if(MyView == 'F'){
lcdtmp[0] = DECtoASCII(DegF,'h');
lcdtmp[1] = DECtoASCII(DegF,'l');
lcdtmp[2] = 0xDF;
lcdtmp[3] = 'F';
lcdtmp[4] = ' ';
} else {
lcdtmp[0] = DECtoASCII(DegC,'h');
lcdtmp[1] = DECtoASCII(DegC,'l');
lcdtmp[2] = 0xDF;
lcdtmp[3] = 'C';
lcdtmp[4] = ' ';
}
if(KeyPORT == MENU) MainMenu();
LCD_LINE(2);
LCD_STR((unsigned rom char*)"Temp: ");
LCD_STR2(lcdtmp);
DelayMS(DelayTime);
oldresult = result;
__________________ AtomSofts eBay Store AtomSoftTech: C18 TIPS & TRICKS v9 PDF Nokia 6100 Driver/Software My Name: Jason Lopez http://atomsofttech.info/ | My YouTube Videos! My Favorite Store: dipmicro Electronics Last edited by AtomSoft; 25th October 2009 at 08:18 PM. | |
| |
| | #92 |
|
ok, not sure if i understand all that lol, will have a look through what I have and try and figure out the rest. Thanks again for all the help | |
| |
| | #93 |
|
heh no problem if you need help just ask ok
__________________ AtomSofts eBay Store AtomSoftTech: C18 TIPS & TRICKS v9 PDF Nokia 6100 Driver/Software My Name: Jason Lopez http://atomsofttech.info/ | My YouTube Videos! My Favorite Store: dipmicro Electronics | |
| |
| | #94 |
|
Sure will, thanks you have taught me a lot rther than just saying do this... cause i said so. Thanks | |
| |
| | #95 |
|
thanks for saying thanks! heh i like helpin
__________________ AtomSofts eBay Store AtomSoftTech: C18 TIPS & TRICKS v9 PDF Nokia 6100 Driver/Software My Name: Jason Lopez http://atomsofttech.info/ | My YouTube Videos! My Favorite Store: dipmicro Electronics | |
| |
|
| Tags |
| lcd, menu |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| LCD menu in C? | picstudent | Micro Controllers | 1 | 13th September 2009 04:48 AM |
| LCD+keypad interface -> menu structure. Concepts sought. Assembly. PIC. | astronomerroyal | Micro Controllers | 23 | 29th August 2008 04:59 AM |
| LG CRT Repair and servce menu. | dark666 | General Electronics Chat | 0 | 7th June 2008 06:17 PM |
| Electronic Music Menu | cyprio7 | General Electronics Chat | 0 | 11th April 2008 04:50 PM |
| One menu, multiple pages. Anyone good at websites? | ThermalRunaway | Chit-Chat | 6 | 25th June 2006 11:45 AM |