In the code snippet below I can output SPI at a frequency that I need. However, I can only output 1 continuous command. I would like to be able to burst more that 1 command at a time at a 1000Hz frequency. For example, instead of sending rgdData only, i would like to send (rgdData, rgdData2, rgdData3, rgdData4 ) and repeat. Is there any way to do this in python? I am trying to mimic the sensor feature in the waveforms GUI. I can do it there but not in python. I've also attached my full python code.
Question
bobql
Hello,
In the code snippet below I can output SPI at a frequency that I need. However, I can only output 1 continuous command. I would like to be able to burst more that 1 command at a time at a 1000Hz frequency. For example, instead of sending rgdData only, i would like to send (rgdData, rgdData2, rgdData3, rgdData4 ) and repeat. Is there any way to do this in python? I am trying to mimic the sensor feature in the waveforms GUI. I can do it there but not in python. I've also attached my full python code.
----------------------------------------------------------------
# data sent out LSB first
dwf.FDwfDigitalOutDataSet(hdwf, c_int(2), byref(rgdData), c_int(cBits))
dwf.FDwfDigitalOutWaitSet(hdwf, c_double(spi_delay(hzFreq, 1e-5)))
dwf.FDwfDigitalOutRepeatSet(hdwf,0)
dwf.FDwfDigitalOutConfigure(hdwf, c_int(1))
print("Generating output for 5 seconds...")
time.sleep(5)
dwf.FDwfDeviceCloseAll()
DigitalOut_SPI v5 32bit works.py
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now