An unofficial place for all things Arduino! We all learned this stuff from some kind stranger on the internet. Bring us your Arduino questions or help answer something you might know! 😉

I am using a Teensy 3.2 and this Geiger counter kit.

I whipped up a little script to measure the time interval between clicks, and I think it works, at least it does spit numbers at me.

What I have done is to grab the time intervals between clicks, toss the first integer since it will never be 0, and use the rest to build random numbers.

I am a casual coder at best, so what I am curious about is how to best write a “give me the exact time interval between HIGH and LOW from a given pin” script.

What all needs to be taken into account here in order to get full accurate measurements?

My first thought is how to factor in communication speed between teensy and PC, how should I send the time intervals, one by one as they come, or build a little list to have a buffer? Would using an RTC bring anything to the table?

I don’t know how well my current setup actually works, particularly when I hold some Uranium glass, or Americium close to the tube and it starts clicking like crazy and working fast.

elapsedMicros count; void setup() { Serial.begin(9600); pinMode(2, INPUT_PULLUP); pinMode(13, OUTPUT); } void loop() { digitalWrite(13, LOW); attachInterrupt(digitalPinToInterrupt(2), clickCount, FALLING); } void clickCount() { digitalWrite(13, HIGH); Serial.println(count); count= 0; }

I’d like to hear any and all feedback and recommendations.

Thanks!

You are watching: Dive into anything. Info created by GBee English Center selection and synthesis along with other related topics.