Go Down

Topic: sine wave generator (Read 4 times) previous topic - next topic

aphy

oh yes. that would make it 12.5
thank you very much!!! :D

AWOL

You'll probably find that you need shorter delays than that (you can't have a x.5us delay anyway) to account for the overheads of "digitalWrite".
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

aphy

then what could be the best way to do? and amplifier for the square wave? thanks

AWOL

Quote
then what could be the best way to do?

Get hold of an oscilloscope or a frequency counter, and tweak your loop times until you get closest to 40kHz.

Quote
and amplifier for the square wave?

MAX232 or similar.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

robtillaart

Quote
to account for the overheads of "digitalWrite".


For those frequencies you might also need a look into direct port manipulation: - http://www.arduino.cc/en/Reference/PortManipulation

You must know the pin in advance, but thats not the problem I guess
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up