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

Different Messages Display On LCD

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



Joined: 25 Jul 2012
Posts: 20

View user's profile Send private message

Different Messages Display On LCD
PostPosted: Wed Aug 08, 2012 12:57 am     Reply with quote

Dear Experts
I want to show these message as below mention procedure.
1- When any PORTB,0,1,2,3 bit is low first its message comes first row and first column.
2- After that any other bit is low its message comes at first row and first column and existing message come to forward on that row.
3- If any of above mention PORTB bit is high that message is automatically disappear.
Example.
1- First comes PORTB,3 is low its message "WTG" is appear at (1,1) .
2- Second comes PORTB,1 is low its message "SOL" is appear at(1,1) and existing message "WTG" comes to (5,1).
3- Third comes PORTB,0 is low its message "AC" is appear at (1,1) and existing messages "SOL" comes to (4,1) and "WTG" comes to (8,1) and continues. AC SOL WTG like this on lcd first row
4- If any of above bit is high that only specific message disappear from screen. Example: if PORTB,1 is high and other two at low state. Then lcd first row shows like that "AC" is (1,1) and "WTG" is (8,1). The space between 4 to 6 at first row is blank.


I think you all understand what i need. Please help me out to solve that problem.

Code:

#include <16F72.H>
#device adc=8
#fuses HS, NOWDT,NOPROTECT,NOBROWNOUT,PUT

#use delay(clock = 16000000)

#byte PORTA = 0x05
#byte PORTB = 0x06
#byte PORTC = 0x07

#byte TRISA = 0x85
#byte TRISB = 0x86
#byte TRISC = 0x87

#include <flex_lcd.c>

void CPU_SETUP(void);

void main()

{
CPU_SETUP();
lcd_init();

while(1)
  {
   lcd_gotoxy(1,1); //make sure at top corner

if( !bit_test(PORTB,0) )

        printf(lcd_putc,"AC ");

   else
      printf(lcd_putc,"   ");

 if( !bit_test(PORTB,1) )

      printf(lcd_putc,"SOL ");

   else
      printf(lcd_putc,"    ");

 if( !bit_test(PORTB,2) )

      printf(lcd_putc,"INV ");

   else
      printf(lcd_putc,"    ");

 if( !bit_test(PORTB,3) )

      printf(lcd_putc,"WTG ");

   else
      printf(lcd_putc,"    ");
}
}

void CPU_SETUP()
{   
   setup_ccp1(CCP_OFF);   // not use comparator module
   setup_adc_ports( All_ANALOG  );
   setup_adc(ADC_CLOCK_div_32);
   TRISA=0b00111111;
   TRISB=0b11111111;
   TRISC=0b00000000;
   
}   


Last edited by engrmunir786 on Wed Aug 08, 2012 11:26 pm; edited 1 time in total
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Wed Aug 08, 2012 9:53 am     Reply with quote

What does your code do/not do that it's supposed to?

Mike
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Wed Aug 08, 2012 10:17 am     Reply with quote

Could you also please go back to the subject of this post and put in something more meaningful?

when people search the forums, scanning the titles is one method and "help me" isn't very descriptive.

It also helps people decide to look at a thread (for help or to help) when scanning the thread list.

Regards,

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
engrmunir786



Joined: 25 Jul 2012
Posts: 20

View user's profile Send private message

Differnet Messages Display On LCD
PostPosted: Wed Aug 08, 2012 11:26 pm     Reply with quote

Dear All
Help me to show these message as my requirement.
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Thu Aug 09, 2012 12:50 am     Reply with quote

engrmunir786 wrote:
Dear All
Help me to show these message as my requirement.


Close, but you need to go back and edit your first post in this thread and change the subject line there..

Looks like you got it... nevermind...

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
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