output of arduino uno on dso

i want to display output of arduino uno on dso. but i have generated sinewave within arduino uno using for loop. i have already tried sending the output of for loop on some other pin and using it as output pin. i can view the sine wave on serial plotter but not on dso. i am attaching my code alongwith it. can anyone plz help me in this matter.

arduino_sine.ino (403 Bytes)

i have already tried sending the output of for loop on some other pin and using it as output pin.

Please post what you tried

thnk u so much for rplying

arduino_sine.ino (494 Bytes)

The OP’s code

#include "math.h"

void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  for(double i= -1.0; i<=1.0; i=i+1.0)
    {
     
      Serial.println(sin(i));
      delay(10);
    
        for(double i=1.0; i>=-1.0;i=i-0.1);
          { 
            Serial.println(sin(i));
            delay(10);
            }  
}}

A DSO measures a varying voltage and displays it on its screen.

An Arduino cannot produce a varying voltage directly. It’s I/O pins are either at 0v or at 5v.

You could program an Arduino to vary the duty cycle of a PWM output (analogWrite() ) in a sinusoidal pattern and feed that into an averaging circuit to get an average voltage for input to the DSO - but I’m afraid the design of the averaging circuit is beyond my pay grade.

…R

trivalli: thnk u so much for rplying

The code you attached has no output to a pin but as Robin has explained it would not matter even if it did.