jimmyvarghese143
New Member
i want write a program for switch control.when RD7 and RA4=1 then only the switch wil work.
this is my program
#include<pic.h>
#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;
PORTC=0x02;
PORTC=0X00;
TRISA=0x08;
i=0;
while(RD7&&RA4=1) //<============ is it correct?
{
i++;
PORTD=map;
PORTB=0x01;
_delay(196999);
PORTB=0x00;
}
}
this is my program
#include<pic.h>
#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;
PORTC=0x02;
PORTC=0X00;
TRISA=0x08;
i=0;
while(RD7&&RA4=1) //<============ is it correct?
{
i++;
PORTD=map;
PORTB=0x01;
_delay(196999);
PORTB=0x00;
}
}