How to create 15 Hz signal from Teensy 3.2?

snowface

Member
Hello,
I would like to create a 15 Hz signal from Teensy 3.2 with 20% duty cycle. I would assume using delay() in loop will not be very efficient, can I please get recommendations on how to program this?

Thanks
 
I am also able to create a 15 Hz pulse using the following code, but how do I get the pulse timestamp?

Code:
analogWriteFrequency(5, 15);
  analogWrite(5, 128);
 
I am also able to create a 15 Hz pulse using the following code, but how do I get the pulse timestamp?

Code:
analogWriteFrequency(5, 15);
  analogWrite(5, 128);

Oh my.. you did not mention any timestamp in post #1.
Yes just use delay().
You can also try a pin interrupt which store millis() or micros().

But most important is to give us all informatio about what you need... not the half only.
 
You can also try a pin interrupt which store millis() or micros().

I tried attaching an interrupt on pin5, didn't work.
I also tried connecting pin 5 to pin 6 and then attaching an interrupt to pin 6, this didn't work either.

Please let me know what do you suggest.
 
Back
Top