amitdandyan
Newbie level 6
delay_us with variable delay+mikroc
I have developed this simple program using mikroC. Can i change the delays given in this program using serial communication of PIC18F252 with PC? (by denoting time with some variables)
Please give essential conditions required for interfacing.
#define switch PORTB.F0
#define Pressed 0
void main()
{
TRISC=0;
TRISB=1;
PORTC=0;
PORTB=0;
for(;
{
if (switch == Pressed)
{
PORTC=0X02;
Delay_us(1);
PORTC=0X00;
Delay_us(240);
PORTC=0X04;
Delay_us(1);
PORTC=0X00;
Delay_ms(2000);
}
}
}
If there's any other way, than also please let me know?
Thank You.
I have developed this simple program using mikroC. Can i change the delays given in this program using serial communication of PIC18F252 with PC? (by denoting time with some variables)
Please give essential conditions required for interfacing.
#define switch PORTB.F0
#define Pressed 0
void main()
{
TRISC=0;
TRISB=1;
PORTC=0;
PORTB=0;
for(;
{
if (switch == Pressed)
{
PORTC=0X02;
Delay_us(1);
PORTC=0X00;
Delay_us(240);
PORTC=0X04;
Delay_us(1);
PORTC=0X00;
Delay_ms(2000);
}
}
}
If there's any other way, than also please let me know?
Thank You.