2013-03-14 11:52:38 +00:00
|
|
|
#include "mbed.h"
|
|
|
|
|
|
|
|
#ifdef TARGET_KL25Z
|
2013-04-11 16:13:23 +00:00
|
|
|
DigitalOut out(PTD4);
|
2013-04-17 15:32:49 +00:00
|
|
|
|
2014-03-08 21:26:09 +00:00
|
|
|
#elif defined(TARGET_KL05Z)
|
2013-06-27 21:20:47 +00:00
|
|
|
DigitalOut out(PTB1);
|
|
|
|
|
2014-03-08 21:26:09 +00:00
|
|
|
#elif defined(TARGET_KL46Z)
|
2013-10-01 18:18:39 +00:00
|
|
|
DigitalOut out(PTA1);
|
|
|
|
|
2014-04-03 19:30:01 +00:00
|
|
|
#elif defined(TARGET_K64F)
|
|
|
|
DigitalOut out(PTA1);
|
|
|
|
|
2014-03-08 21:26:09 +00:00
|
|
|
#elif defined(TARGET_LPC812)
|
2013-04-17 15:32:49 +00:00
|
|
|
DigitalOut out(D10);
|
|
|
|
|
2014-05-02 18:54:40 +00:00
|
|
|
#elif defined(TARGET_NUCLEO_F103RB) || \
|
|
|
|
defined(TARGET_NUCLEO_L152RE) || \
|
|
|
|
defined(TARGET_NUCLEO_F302R8) || \
|
|
|
|
defined(TARGET_NUCLEO_F030R8) || \
|
2014-05-14 13:54:11 +00:00
|
|
|
defined(TARGET_NUCLEO_F401RE) || \
|
2014-06-23 14:56:25 +00:00
|
|
|
defined(TARGET_NUCLEO_F411RE) || \
|
|
|
|
defined(TARGET_NUCLEO_F072RB) || \
|
|
|
|
defined(TARGET_NUCLEO_F334R8) || \
|
2014-05-14 13:54:11 +00:00
|
|
|
defined(TARGET_NUCLEO_L053R8)
|
2014-05-16 13:29:51 +00:00
|
|
|
DigitalOut out(LED2);
|
|
|
|
|
|
|
|
#elif defined(TARGET_LPC11U68)
|
|
|
|
DigitalOut out(LED2);
|
2014-04-30 12:56:18 +00:00
|
|
|
|
2013-03-14 11:52:38 +00:00
|
|
|
#else
|
2014-07-01 12:22:03 +00:00
|
|
|
DigitalOut out(LED1);
|
2013-03-14 11:52:38 +00:00
|
|
|
#endif
|
|
|
|
|
2013-04-11 16:13:23 +00:00
|
|
|
DigitalOut led(LED1);
|
2013-03-14 11:52:38 +00:00
|
|
|
|
2014-03-19 19:57:02 +00:00
|
|
|
#define MS_INTERVALS 1000
|
|
|
|
|
|
|
|
void print_char(char c = '*')
|
|
|
|
{
|
|
|
|
printf("%c", c);
|
|
|
|
fflush(stdout);
|
|
|
|
}
|
2013-06-27 21:20:47 +00:00
|
|
|
|
2014-05-02 18:54:40 +00:00
|
|
|
int main()
|
|
|
|
{
|
2013-03-14 11:52:38 +00:00
|
|
|
while (true) {
|
2014-05-02 18:54:40 +00:00
|
|
|
for (int i = 0; i < MS_INTERVALS; i++) {
|
2014-03-19 19:57:02 +00:00
|
|
|
wait_us(1000);
|
|
|
|
out = !out;
|
|
|
|
}
|
2013-04-11 16:13:23 +00:00
|
|
|
led = !led;
|
2014-03-19 19:57:02 +00:00
|
|
|
print_char();
|
2013-03-14 11:52:38 +00:00
|
|
|
}
|
|
|
|
}
|