EspoTek / Labrador

EspoTek Labrador is a USB device that transforms your PC or smartphone into a fully-featured electronics lab. This repo holds all of the source code!
http://espotek.com
1.1k stars 116 forks source link

Introducing duty cycle to the Square waveform #264

Open mmehari opened 5 months ago

mmehari commented 5 months ago

Hi again,

For a project I am working on, I want to use a square waveform with configurable duty cycle.

The current version only has fixed (50%) duty cycle and I want to make this configurable.

I am planning to add a Duty cycle item underneath Signal Gen CH1/2 front-end but regarding the back-end implementation, I am thinking of creating the 'duty-cycled' Square waveform inside sendFunctionGenData function (https://github.com/EspoTek/Labrador/blob/master/Desktop_Interface/genericusbdriver.cpp#L144) all from scratch .

This, however, will effectively disregard the waveform data (*Square.tlw) stored locally and I wonder if this is the right approach.

Please let me know if you have other ideas.

Thanks,

EspoTek commented 5 months ago

Go for your life, mate. I think that's the best way to approach it, even if it's a little bit inconsistent.

Have seen your other PR too and will respond during the week!

mmehari commented 5 months ago

Well I couldn't find another approach and once the other PR is finalized, I will issue a new PR for this.