The reason that I am trying to test it is because I am trying to send that pulsing signal from a transmitter to a receiver and I want to determine how many times that the receiver gets a HIGH. This is going to be used to measure distance using time of flight.
The reason that I didn't use analogWrite is because the Reference page says that it can be influenced by how close that your hand is to it, which doesn't work for what I am ultimately trying to do.
muskiepalooza:
The reason that I didn't use analogWrite is because the Reference page says that it can be influenced by how close that your hand is to it, which doesn't work for what I am ultimately trying to do.
The ultrasonic sensor would work in theory, but this project is going to be intended to be used outside. I basically just need to figure out a way to read the input from a receiver and count the amount of HIGHs. I have been playing with it for a few days and just can't get it figured out.
I'd kick off a PWM signal with an analogWrite, and jumper that to my input pin.
I may even change the prescaler and divider values to change the frequency.
No hand-waving involved.
In that case, read the input pin.
If it's high, add 1 to your count.
read it again - it it's not low, keep reading until it does go low.
once low, read it again until it goes high - if it's high, add 1 to your count.
read it again - it it's not low, keep reading until it does go low.
Think you could that? Maybe use while() to wait out the high periods after the input changes from low to high.