-
Notifications
You must be signed in to change notification settings - Fork 8
changing frequency #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Try adding this line before your gen.adjustFreq() line: gen.FreqAdjustMode(MiniGen::FULL); There are several settings for the range of the multiplier, and freqCalc() works for the FULL range. Sorry for the confusion! |
Now, my all code is; #include <SPI.h> MiniGen gen; void setup() gen.setMode(MiniGen::SQUARE); gen.setMode(MiniGen::SQUARE_2); gen.setMode(MiniGen::TRIANGLE); gen.setMode(MiniGen::SINE); } void loop() static float frequency = 200.0; gen.adjustFreq(MiniGen::FREQ0, freqReg); What I mean is getting 20 Hz frequency and increasing it step by step (for example : 10 Hz for every loop) |
Change the "frequency" value to 20 and the frequency+=200.0 line to frequency += 10. |
Hi,
Although I try to change frequency with; (changing frequency=20 Hz and keep it constant)
static float frequency = 20.0;
unsigned long freqReg = gen.freqCalc(frequency);
gen.adjustFreq(MiniGen::FREQ0, freqReg);
delay(100);
My Minigen's output still 150kHz,
Why?
The text was updated successfully, but these errors were encountered: