VoltVolt
Junior Member level 1
- Joined
- Sep 15, 2013
- Messages
- 15
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 124
Hi,
I'm using PIC16F877A with HITECH C
What I'm try to do is to make my LED on while I can execute the next line instruction.
Scenario:
first program(check resistance to determine the LED on or not)
LED blink
second program
What I want is to execute the second program while checking the resistance to determine the LED on or not...
Part of my code:
resistance = (100000 * voltage) / (5 - voltage);
void main1(){
if (resistance <= 50000) {
RD0 = 1;
DelayMs(1000);
} else if (resistance >= 50000) {
RD1 = 1;
DelayMs(1000);
}
}
void main2(){}
void main(void){
main1();
main2();
}
I appreciate if anyone could help... Thx...
I'm using PIC16F877A with HITECH C
What I'm try to do is to make my LED on while I can execute the next line instruction.
Scenario:
first program(check resistance to determine the LED on or not)
LED blink
second program
What I want is to execute the second program while checking the resistance to determine the LED on or not...
Part of my code:
resistance = (100000 * voltage) / (5 - voltage);
void main1(){
if (resistance <= 50000) {
RD0 = 1;
DelayMs(1000);
} else if (resistance >= 50000) {
RD1 = 1;
DelayMs(1000);
}
}
void main2(){}
void main(void){
main1();
main2();
}
I appreciate if anyone could help... Thx...