mostafanfs
Member level 1
- Joined
- Aug 2, 2012
- Messages
- 40
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,611
Hi guys. I've been trying to use mbed library on my LPC1768 board (it's a LandTiger board actually). In this board there are 8 LEDs connected to P2.0 ~ P2.7 and when I try to toggle one of them it wont work at all. Here's the code:
As you can see it's a simple toggle program. What is strange is that it works inside Keil debugger and I can see that P2.0 is toggling.
What's even more strange is that the program will work fine on the board for all the other Ports besides P2[7..0] (even for P2.8 ~ P2.13 will work fine!) so it's not a problem with clock or start-up code or anything else.
So do we have any thoughts? Why am I getting this strange behavior ?
Code:
#include "mbed.h"
DigitalOut myled(P2_0);
int main(void) {
while(1){
myled = 1;
wait_ms(1000);
myled = 0;
wait_ms(1000);
}
}
What's even more strange is that the program will work fine on the board for all the other Ports besides P2[7..0] (even for P2.8 ~ P2.13 will work fine!) so it's not a problem with clock or start-up code or anything else.
So do we have any thoughts? Why am I getting this strange behavior ?