On a bit of a tangent from my Home Easy hacking, I’ve been experimenting with an alternative to the poorman’s oscilloscope. The arduino + processing hack is brilliantly simple but it wasn’t much use with the signals I was trying to look at.
Zelscope looks quite interesting but it’s a trial download, plus I wanted to keep the arduino end of the poorman’s oscilloscope hack the same if possible. The Universal Real-Time Software Oscilloscope GUI DLL Library didn’t initially look as interesting since I was hoping not to have to write any code. On closer inspection, it does have a test .exe which will import data, which only needed a tiny change to the arduino sketch from the original hack:
Serial.print( val );
Serial.print(“\t0.0000000000\t0.0000000000\n\r”);
So just get the data from the serial port, into a file and import it… either I’m missing something or getting data from a serial port on Windows is a bit of a pain. I ended up using PowerShell to do the job, starting with some instructions for reading from a serial port on the PowerShell blog. Unfortunately that doesn’t seem to work, but getting rid of the add_DataReceived line and using ReadLine() did the job:
[string]$str = $port.ReadLine()
Add-Content “C:\Temp\Data.txt” $str
I do wonder if I could use the oscilloscope GUI DLL library directly from PowerShell. I get the impression that might be possible- I expect Dale will know the answer! For now, here are the results importing a file:
Not bad, although I’ve yet to see if it makes finding the signal I want any easier. Next week I’ll be at my mum’s house trying to find an actual oscilloscope which I used to have!
Yeah, it should be do-able to access the DLL in PowerShell
Something like:
[Reflection.Assembly]::LoadFile("c:\path\to\your.dll")
Then use it like:
[YourDllsNamespace.ClassName]::AStaticMethod(arg1, arg2, arg3)
or:
$anInstance = new-object YourDllsNamespace.ClassName
$anInstance.NonStaticMethod(arg1, arg2)
I think… it’s been a while since I’ve played with this stuff.
Thanks Dale. I also discovered another Arduino oscilloscope project on the forum, which has a more advanced sketch for the Arduino side.
Would defintely be interesting to get both working together at some point, but tinkering with Home Easy stuff at the moment thanks to @barnybug sending me in the right direction.