Adafruit_ZeroTimer Usage for CPX

Play with it! Please tell us which board you're using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jimmynewland
 
Posts: 4
Joined: Sun Feb 09, 2014 5:58 pm

Adafruit_ZeroTimer Usage for CPX

Post by jimmynewland »

Hello there,
I am attempting to port the code for the Pulse Sensor Amped (PSA) from an UNO R3 (AVR) to the CPX (SAMD). I am attempting to use the Adafruit_ZeroTimer library but I don't know the usage. I tried using the code from the Pulse Room project since the processor architecture is the same, but I get compile errors on the Adafruit_ZeroTimer setCallback method.

I am using Arduino 1.8.5 and Adafruit_ZeroTimer 2.0.0 and the project code from Pulse Room. interrupt.ino has compiler errors. The same errors show up with both a Feather M0 and a CPX selected as the boards. This is very much out of my comfort zone but I am learning a lot about the microcontroller timing techniques.

Is there an API for Adafruit_ZeroTimer? I need a 2ms counter for a Pulse Sensor Amped project. I did try compiling the examples with the library and got no errors. I am attaching the verbose error log from Arduino IDE. Any help would be awesome!
Attachments
error_log.txt
(13.94 KiB) Downloaded 59 times

User avatar
jimmynewland
 
Posts: 4
Joined: Sun Feb 09, 2014 5:58 pm

Re: Adafruit_ZeroTimer Usage for CPX

Post by jimmynewland »

Well I at least got the code to compile. I noticed the Adafruit_ZeroTimer library had been updated and looked at the examples and saw the call to the constructor was now zero-args. So I got it to compile but I can't get data into the CPX from the A1 pin. I'll keep at it.

User avatar
ctymms
 
Posts: 1
Joined: Sun Jun 03, 2018 12:50 pm

Re: Adafruit_ZeroTimer Usage for CPX

Post by ctymms »

I had a similar compiler error when I first user the 2.0.0 version. The older version was working fine. What I did discover is that the zerotimer library with the Example Callback sketch did not compile properly with the new Itsybitsy M4 express. It shows many non declared tc variables errors. It only shows problem when selecting the ItsyBitsy M4 but complies OK with the Metro M4 and Feather M4.

Locked
Please be positive and constructive with your questions and comments.

Return to “Circuit Playground Classic, Circuit Playground Express, Circuit Playground Bluefruit”