[Tutor] Using Python to send signals to the USB port

Alan Gauld alan.gauld at btinternet.com
Wed Aug 17 19:11:44 CEST 2011


On 17/08/11 14:28, Jaidev Deshpande wrote:
Hi

 > Is there some way I can use Python to send data through a USB port and
 > control the data in real-time?

Yes, but its not what I'd call easy!

 > .... How can I send the digitized form of this array through a USB port,
 > and then convert it back intoanalog so I can view it on an oscilloscope?

The sending to USB is fairly straightforward but to convert that back to
analog once its left the PC you will need some kind of DAC (digital to
analog convertor), you cannot do that from inside the PC! DACs are
relatively easy to find but not that cheap.

But if the frequency is not too high you an probably do it inside the PC
and send the analog out using the loudspeaker or line-out jack. Then
connect that directly to the 'scope.

That should work for frequencies up to 20kHz or so, even 40Khz if you
have a good sound card!...

hth

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list