Analog Discovery 2 Communicates with Arduino

Recently, for a project I was doing, I wanted to use the Analog Discovery 2 to help intelligently interpret live audio and send the data to LED strips controlled by an Arduino. However, in order to do this, I would need WaveForms to have some way to talk to the Arduino. After exploring some options on my own, I turned to the Digilent Forum and posted the following question.

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?

Before I knew it I had a solution proposed to me by attila, a Technical Forum Moderator and WaveForms software developer. He suggested using the Python libraries in WaveForms SDK by doing the following:

You could use the WaveForms SDK. Starting with the or 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,,
The examples are located in the following path: C:/Program Files (x86)/Digilent/WaveFormsSDK/samples/py/

He also suggested that I could also send acquisition data over SPI with a custom script in the script editor like the one shown below:

    var rg16 = []
    var r = Scope1.Channel1.Range.value
    var o = Scope1.Channel1.Offset.value
    // convert float to 16bit integer
        rg16.push(max(-32768, min(32767, v*32768/r+o)))
    if(!Protocol.SPI.Write(16, rg16)) break


For the design I am working on, this communication is essential, as I am basically using the Analog Discovery 2 as an advanced sound sensor. Since my current setup involves manipulating the data from WaveForms in the Arduino IDE, I am going to experiment with attila’s suggested option of using the AnalogIn_Record example scripts to send to the COM port that the Arduino is on.

Stay tuned for updates on this project as well as how to use the Analog Discovery 2 with Arduino!

About Miranda Hansen

I enjoy creative writing, engineering, thinking, building, exploring and sharing with people. Huge aficionado of spending time thinking about things that “don’t matter.” I am very interested in unconstrained creativity. I love cross-discipline ideas and all of their integration into complete original systems. And I like things that do things.

View all posts by Miranda Hansen →

Leave a Reply

Your email address will not be published. Required fields are marked *