Hi Goncalo,
I tried Take and I think I understand parts of what the code is doing but also have questions.
When I set Take to 1, the LED does not turn on. I think the code is reading the negative half of first pulse generated by the FunctionGenerator. When I set Take to 2, the LED blinks once. So that when Take = 2, 4, 6, 8, 10, the LED blinks 1X, 2X, 3X, 4X, 5X, respectively. This is where my understanding ends. :)
This made me think that Take is taking the 1st BufferLength of pulses from the FunctionGenerator. But when I change
the FunctionGenerator properties (i.e., BufferLength, Frequency, and SampleRate, this is no longer the case. What exactly is Take(1) taking as the 1st specified number of contiguous elements from the FunctionGenerator? Does the start of the sequence taken by Take(1) start with SkipUntil?
I noticed that the duration of the LED pulses varies with sequential blinks. With the attached code's FunctionGenerator properties, generally, the 1st LED blink has the longest duration and the last LED blink has the shortest duration. This makes me wonder about the duration of LED blinks in the middle. The variable duration also changes when the FunctionGenerator properties (i.e., BufferLength, Frequency, and SampleRate) are changed. How can I keep the duration consistent between LED blinks?
Also, is the SampleRate property of FunctionGenerator in units of samples/sec?
Is the Frequency unit Hz?
It BufferLength in samples or samples/s?
Thank you!
Sarah