Open vontell opened 7 years ago
It's alternating rises and falls, so all you really need is the initial value. What do you need that for?
My current approach is also to use the initial value. However, how would I get this initial value; is there a TTLInOut method which would allow me to query the current input state of the channel? desired functionality is at issue vontell/artiq-control#7
In 3.x you can use this: https://m-labs.hk/artiq/manual-master/_modules/artiq/coredevice/ttl.html#TTLInOut.sample_input But doing what you want without any race condition is not completely straightforward (e.g. what happens if an edge arrives at the same time as when you are sampling the first time?)
The
gate_both(self, duration)
method, or_set_sensitivity(3)
configuration for a TTLInOut object returns timestamps at which a rising or falling edge has been detected. However, is there any way to determine if the edge was a rise or fall, such as a tag which gets sent with the timestamp?