it works with onboard led
#include "mbed.h"
DigitalInOut Clock(LED1);
main()
{
Clock.output();
while(1)
{
Clock.write(0);
wait_ms(500);
Clock.write(1);
wait_ms(500);
}
}
also this works too:
#include "mbed.h"
DigitalInOut Clock(LED1);
void clocktick()
{
Clock = !Clock;
}
main()
{ Clock.output();
Ticker ticker;
ticker.attach(clocktick,1 );
while(1)
{
;
}
}
Except that I don't know what's behind "..." on first example and you forgot to set output on the second example .. nothing's wrong.
See that if your p7 is ok .. try another pin.
Anyway if you don't need input on this clock ... it may be more elegant to use pwm output instead for generating clock.
Hi,
I'm new to mbed and try to create a clock signal on pin p7
First try:
but there is no reaction on p7 to see with an oszi.
Second try:
But this has also no effect on p7.
Is something missing?
Thx
Update:
if I use DigtalOut it works! But why does DigtalInOut not work for that ???