Closed colinoflynn closed 10 years ago
Also: since I noticed you added AWG code, I want to pull in some code I have which can generate UART code (https://www.assembla.com/code/chipwhisperer/git/nodes/master/software/capturev2/utils/SerialProtocols.py), so in a pinch can send serial data out the AWG at any baud rate you want... useful for testing limits of baud rate
I definitely broke some of your code. I think I made things more "backwards compatible" with what you had before in later versions because I tried to run your examples.
Currently I only have the built in signal generator code. I like to use it to test the oscilloscope with itself.
Honestly, last night I was struggling with this issue: http://www.picotech.com/support/topic12969.html then at midnight things magically worked (without changing any of the code... so I don't know what happened). I have a feeling their DAC is getting stuck in a weird state and once it gets out of that state, things are OK.
I'll probably add the AWG code in a few days. Holidays you know.... I should have some matlab code to base it on... if I can find it.
About the Serial Code, it doesn't seem very appropriate to have it inside the Picoscope class to me. I say this because you might get an other oscilloscope/waveform generator that you want to do the same thing with. That being said, we aren't getting PhDs to write a picoscope python wrapper. If it will make your life easier to include it in, then by all means do it.
Also, I'm using this as an excuse to learn Python since I got bored of Matlab's weird syntax.
I split this it into the multiple issues you listed: https://github.com/colinoflynn/pico-python/issues/3 https://github.com/colinoflynn/pico-python/issues/4 https://github.com/colinoflynn/pico-python/issues/5
Also, do you have an editor that can strip trailing whitespaces? I ask this because my editor will do it automatically and we will just have about 100 lines per commit that will be me removing whitespace and you adding it.
There is a way to tell git not to allow commits with trailing whitespaces but I wasn't able to do get it to work. Maybe that was just because it didn't recognize .m files code though.... that darn matlab editor won't do it for your :S.
About the Serial Code, it doesn't seem very appropriate to have it inside the Picoscope class to me.
Ah - yeah not inside the picoscope class sorry, more of an 'example'. An idea what you can do with the picoscope awg!
Also, I'm using this as an excuse to learn Python since I got bored of Matlab's weird syntax.
Sure thing - Python is very nice compared to MATLAB ;-)
I think I made things more "backwards compatible" with what you had before in later versions because I tried to run your examples.
Don't worry about that - I'll fix examples after the holiday! Nobody else is using this code AFAIK (just released it) so don't worry about breaking things right now...
Also, do you have an editor that can strip trailing whitespaces?
Yeah, I'll switch to using my normal editor. I hacked this out in IDLE (the Windows-based editor that comes with Python & is somewhat limited), I normally use Eclipse which is much more 'sane'. BTW do you have any issues with line endings? I think they might be Windows-style in the repo I can't remember, but we could switch them to using Unix in the repo if not, which will be fixed by the 'core.autocrlf' attribute. If you haven't had issues could leave it all alone..
Actually, the ps6000.py file has Unix line endings.
Any sane editor works with both and will stick to one for the duration of a file, so I don't really mind.
autocrlf can't hurt though, but it is entirely optional.
I'm finally back from the holiday break, so will be looking to do some updates probably later today. If you're holding out on any updates you'll be pushing in let me know & I won't touch anything.
I'm good, I should probably learn how to use branches and merge/rebase between them.
Ah yeah... if you've got major changes planned that's handy! May start a brach for reorganizing. Anyway did a few small changes now & am done for now. I deleted some functions that looked to be unused now (e.g. getData replaced by getDataV). If I missed some feel free to be ruthless in trimming unused functions, we can each fix our demos to use the new ones ;-)
I don't think we need this issue anymore. Lets just keep small issues.
Some notes on things which will be fixed/improved:
-Pick a license (FreeBSD perhaps?) -Add @hmaarrfk to copyright text -Remove the 'other stuff' files I was stashing -Make an examples directory perhaps?
I don't have a scope with me right now (holidays) so won't be commit anything w/o one, since I can't check if I've broken something!
@hmaarrfk: If you see big changes are needed somewhere (e.g. you think there is a better way to do something) let me know, I'm very open to large changes! I don't claim to have done everything correctly ;-)