Help me.....

Status
Not open for further replies.
include<stdio.h>


void main()

{
int i;
char map[10]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};
TRISD=0x00;
TRISC=0x00;
TRISB=0X00;
TRISA=0XF0;
RC1=0;
i=0;

while(i<9)
{
i++;
PORTD=map;
PORTB=0x01;
_delay(196999);
PORTB=0x00;
_delay(196999);
RC1=1;
//RB5=1;
RC0=0;
}



this program is working in good condition.but i want add a switch control to it.now it is increament continuously.so i want to change this one as when we press the push button
then only the increment happen.
 
You can use an if structure like this..

while(1)
{
if(switch==1)
{...}
}

can you please edit my program?am using develoment kit for my programming.same ports are used for many application.so for enable the switch first i want to set RD4==1;my switch is RA4.so how to connect these two thing in my program.when both RA4 and RD7 is high then only the switch will work.
 
Last edited:
Programming doubt

You can use an if structure like this..

while(1)
{
if(switch==1)
{...}
}

can you please edit my program?am using develoment kit for my programming.same ports are used for many application.so for enable the switch first i want to set RD4==1;my switch is RA4.so how to connect these two thing in my program.when both RA4 and RD7 is high then only the switch will work.


am attaching my development kit manual with this..
 

Attachments

  • arrangedMicromas&#116.pdf
    248.3 KB · Views: 338
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…