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-04-30 12:56:18 +00:00
|
|
|
#elif defined(TARGET_NUCLEO_L152RE)
|
|
|
|
DigitalOut out(LED1);
|
|
|
|
|
2013-03-14 11:52:38 +00:00
|
|
|
#else
|
|
|
|
DigitalOut out(p5);
|
|
|
|
#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-03-19 19:57:02 +00:00
|
|
|
int main() {
|
2013-03-14 11:52:38 +00:00
|
|
|
while (true) {
|
2014-03-19 19:57:02 +00:00
|
|
|
for (int i = 0; i < MS_INTERVALS; i++)
|
|
|
|
{
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|