ahmedabosriaa
Newbie level 5
- Joined
- Nov 26, 2012
- Messages
- 10
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,337
Hi guys
I have a problem, hope to find help here
This is a simple program to let (B1= High) if (set = 8.1)
Unfortunately it doesn't work BUT it works only if we replaced the condition to (set<5.4 OR set<2.7).
So, could anyone tell me what is the problem.
I have a problem, hope to find help here
This is a simple program to let (B1= High) if (set = 8.1)
Unfortunately it doesn't work BUT it works only if we replaced the condition to (set<5.4 OR set<2.7).
So, could anyone tell me what is the problem.
double set;
void main() {
ANSEL =0b00100001;
GPIO=0;
TRISIO=0b000001; // All pins are output except pin one
while(1){
set=0;
while(set<8.1){
set+=2.7;
}
if(set == 8.1){
GPIO.B1 = 1;
}
}
}