Question on the formula for finding the frequency when doing the ultrasonic transmitter project.
Posted: Mon Oct 06, 2025 4:56 pm
Hi I am back again with another question, i am trying to use the provided formula to find the frequency.
periodMS = 4*numPulses*(Delaytime+digitalwritetime)
Frequency(Hz) = 1/periodS
i am using the formula but it is giving me an unrealistic frequency, when i use the variables given in the video the resulting frequency is 208hz. Can you please tell me what i am doing wrong. I created a python script to do it automaticallly maybe i messed that up.
Code:
delayTime = 10
numPulses = 5
digitalWriteTime = 2
offTime = 2*(digitalWriteTime+delayTime)*numPulses
periodMS = 4*numPulses*(delayTime+digitalWriteTime)
periodS = periodMS/1000000
frequency = 1/periodS
print(frequency)
periodMS = 4*numPulses*(Delaytime+digitalwritetime)
Frequency(Hz) = 1/periodS
i am using the formula but it is giving me an unrealistic frequency, when i use the variables given in the video the resulting frequency is 208hz. Can you please tell me what i am doing wrong. I created a python script to do it automaticallly maybe i messed that up.
Code:
delayTime = 10
numPulses = 5
digitalWriteTime = 2
offTime = 2*(digitalWriteTime+delayTime)*numPulses
periodMS = 4*numPulses*(delayTime+digitalWriteTime)
periodS = periodMS/1000000
frequency = 1/periodS
print(frequency)