• 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now