[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself

Search:


View post   

>> No.1161616 [View]
File: 457 KB, 1600x1200, Cat repeller.jpg [View same] [iqdb] [saucenao] [google]
1161616

>>1161611
>interfacing is a bitch
Why's that?
Are other ones easier?

5110 is the only one I've used.

>> No.1126427 [View]
File: 457 KB, 1600x1200, Cat repeller.jpg [View same] [iqdb] [saucenao] [google]
1126427

>>1126379
Might be easier to think "time" rather than "frequency" (TIME = 1/FREQUENCY)

>8 bit MCU
More bits is fine. I think speed would be more important.
>input signal through the internal ADC
Any uC with an ADC like Arduino or MSP430 would work.
>outputs the signal as a square wave
that's just digital output

I think the hardest part would be measuring the frequency.
You'd sample the ADC and store results, but not sure on the algorythm to detect the distance between cycles of a sin wave.
Probably find the peaks or zero-crossing.
Might be easier to amplify the signal to a clipped semi-square wave and just measure the on+off time through a digital pin rather than an analog one. IDK

The rest wouldn't be too bad to code I don't think.
-calculate the "on time" of the input frequency (1/F)2
-Using the timer, set up a delay, calling an interrupt every 1/4 of the input "on" time
-in the interrupt function keep a count of calls with a static or global variable
toggle the F/4 pin every interrupt
toggle the F/2 pin every other interrupt
toggle the F/1 pin every 4 interrupts

Maybe you can help me with something:
As you said, a lower octave is 1/2 the frequency.
Is there a formula to calculate note frequencies without a list?
I mean if note A6 is 1760Hz, is there a formula to calculate the frequency of B6?

Navigation
View posts[+24][+48][+96]