Open iw2evk opened 1 year ago
This library generates the values needed to make a sine wave. To actually see a sine wave on a scope, you would need to send those values to a DAC.
I've used the pwm internal to Arduino but the sampling frequency It's too low for sagomate with a R/c filter Amy suggestioni?
Il sab 23 set 2023, 02:41 Electronics-Workshawp @.***> ha scritto:
This library generates the values needed to make a sine wave. To actually see a sine wave on a scope, you would need to send those values to a DAC.
— Reply to this email directly, view it on GitHub https://github.com/Electronics-Workshawp/WaveCraft/issues/1#issuecomment-1732150886, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKPWRGJIL47VGXSNAFUQWLX3YV3TANCNFSM6AAAAAA32C2LZU . You are receiving this because you authored the thread.Message ID: @.***>
Hi,
i've created this simple sketch for generate a sine wave of 71.9 hz on pin 13 of arduino nano
include //carico libreria
WaveCraft wave1(1, 100);
// inizializzo la seriale e setto i baud di trasmissione void setup() { Serial.begin(500000); pinMode(13, OUTPUT); // setto il pin di uscita }
void loop() {
wave1.setFrequency(71.9); //carico la frequenza in Hz wave1.setLow(0); // carico il valore minimo wave1.setPhase(0); // carico la fase wave1.setHigh(255); // carico il valore massimo
Serial.print(wave1.getValue()); //plotto su seriale l'uscita per test Serial.print(" "); Serial.print(255); Serial.print(" "); Serial.print(0); Serial.print(" "); Serial.println(" "); int wave = wave1.getIntValue(); analogWrite(13, wave); }
running i plot the wave with integrated IDE arduino plotter like sine wave, but on pin13 hecked with oscilloscope it's presenta square wave! This library it's intende only for plotter sine wave on ide plotter or for generate true sine wave on pin ?
Thanks
Roberto