- #1
smokingwheels
- 70
- 0
Homework Statement
Adjust a program loop so frequency will change linearly with a keyboard increment or decrement.
The current calculation adjusts about 40 counts in the delay loop but when the frequency gets high the step is frequency is very large with each decrement in the loop.
A loop delay of 0 counts is 428 Hz eg as fast as the program will run
A loop delay of 10000 counts is 4.911 Hz
A loop delay of 49840 counts is 1 Hz
Homework Equations
1/Period = Frequency and 1/Frequency = Period
The Attempt at a Solution
tid# is the adjustment frequency controlled from keystrokes either increment or decrement in small steps eg + .02 or - .02
id& is the number of loops in the counter eg period
incdelay:
tid# = tid# + .02
id& = 1 / ((1 / tid#) * (1 / 2000))
RETURN
Its part of a 3 phase digital to analog converter driven off a printer port using QuickBASIC and win98 and below, using 3 4 bit 8421 ladder networks.
I made the prototype to drive 3 speakers 120 degrees apart. I intend to finsh the program so that you can record the frequencys and phase shifts for Rubens tube experments.