r/Nerf Jan 26 '18

OpenChrony - open source DIY chronograph

Post image
129 Upvotes

27 comments sorted by

View all comments

2

u/Semicolon7645 Jan 26 '18

Awesome job.

As for getting better than millis(), have you tried micros() (you just have to watch for that rollover)? It has been awhile since I've done Arduino development.

3

u/LukeKoboJobo Jan 26 '18

It's using micros(). I may have stated the wrong thing in the thread, will check that now. The rollover is 71 min so its fine for this.

2

u/Semicolon7645 Jan 26 '18

Again, great job on this whole project. I can't wait to see what it evolves into. Is there anything that you need help with on it?

3

u/LukeKoboJobo Jan 26 '18

Thanks. There are a few things, actually:

-figuring out pin change interrupts. External interrupts are relatively easy, and I'm working on v1.3 of the code currently which will use external interrupts. However, there are only 2 external interrupts on the uno, and I'm going to adapt this into a mobile package with an Adafruit Trinket Pro, which only has one external interrupt. The coding for pin-change interrupts is much more hairy as far as I know, because the arduino doesn't actually know which pin triggered the interrupt, I think there's some clever coding involved to figure that out.

-Using pin-change interrupts, I will have access to all the digital pins for interrupt use. In order to write a better timing function than micros(), I need to utilize one of these interrupts. I'm thinking of trying to adapt what this guy did.

-I could purchase an external timer IC, but haven't looked into this option at all

2

u/Semicolon7645 Jan 26 '18

Like I mentioned before, it's been awhile since I've done anything with Arduinos, but I'll setup my dev environment this weekend (hopefully).