• 0
Mirandamay

How to Send Signal to Arduino with Analog Discovery 2?

Question

Hello,

 I am trying to send oscilloscope data from the Analog Discovery 2 to the Arduino Uno. Would there be a way I could do this so that the Arduino could read it in live time?

 

Miranda

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 1

Hi @Mirandamay

You could use the WaveForms SDK. Starting with the AnalogIn_Record_int16.py or AnalogIn_Record.py example script and modifying it to send the data chunks from the record loop to the desired protocol (like COM), or using the device DIO (see Digital_Spi.py, Digital_Uart.py, Digital_I2c.py)
The examples are located in the following path: C:/Program Files (x86)/Digilent/WaveFormsSDK/samples/py/ 
image.png.0f88183b5798f461989d6d3eda2669f5.png

You could also send acquisition data over SPI with the WaveForms application like this:

image.thumb.png.9cd9a4660b5dd7cc9882b195e71307c7.png

Scope1.run()
while(Scope1.wait()){
    var rg16 = []
    var r = Scope1.Channel1.Range.value
    var o = Scope1.Channel1.Offset.value
    // convert float to 16bit integer
    Scope1.Channel1.alldata.forEach(function(v){
        rg16.push(max(-32768, min(32767, v*32768/r+o)))
    })
    Protocol.SPI.Start()
    if(!Protocol.SPI.Write(16, rg16)) break
    Protocol.SPI.Stop()
}

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.