PaulStoffregen / FreqMeasure

Measures the elapsed time during each cycle of an input frequency.
http://www.pjrc.com/teensy/td_libs_FreqMeasure.html
69 stars 31 forks source link

Using SAMD21G18 MCU #16

Open mrguen opened 6 years ago

mrguen commented 6 years ago

Description

Hello, I would like to use your library with an Arduino M0 board.

As suggested on https://www.pjrc.com/teensy/td_libs_FreqMeasure.html I am trying to adapt FreqMeasureCapture.h

Since Teensy LC uses a cortex M0 I was considering changing these lines in FreqMeasureCapture.h to simply recognize the Arduino M0 mcu

elif defined(MKL26Z64) || defined(SAMD21G18A)

define CAPTURE_USE_FTM1_CH0 16 // FTM1 CH0 is pin 16

It does indeed recogn the chip,but the compiler does not know any of the variables like FTM1_MOD etc...

How can I adapt your code and map the variables for SAMD21G18 ? I haven't seen any Teensy files that would define the variables.

Thanks

Hardware & Software

Board: Arduino M0 Arduino IDE version 1.8.5