Hacker News new | ask | show | jobs
by yetihehe 4474 days ago
Maybe you don't need to do it in software? If you get LCD with LED backlight, you can turn it on and off from arduino or even external device itself. It would have nanoseconds of latency (it depends on length of cables now). If you need software solution I would propose C/C++ and linux, if you use library which handles high resolution timers, it's rather easy to achieve sub 1ms latency.
3 comments

You should also know that at such frequencies, displaying hardware matters. You can have distortions from refreshing frequency. If you show and hide image in software at 50hz and your display refreshes at 60hz, you eaither have tearing (one part of screen is black, other still has image) or "frame drops" when you use v-blanking synchronization (http://en.wikipedia.org/wiki/Vertical_blanking_interval). Such artifacts ARE visible in case of image/noimage transitions and can alter results of experiment. Your friend should use some 200hz tv for tests. For measuring on/off, he could also mask some part of screen, display a white rectangle there and measure on/off with a photodiode (photoresistor may be too slow) under this mask. Of course just turning LED backlight on and off won't have such problems if displayed image is still static.
Maybe you don't need to do it in software?

That's my thought. An optical sensor that detects changes to the screen from the viewer's perspective would provide an accurate signal and decouple the instruction timing. from hardware response.

Measure the results not the inputs.

Thanks for your thoughts. The issue is user should be able to interact with the system. For example after viewing the flickering image for couple of seconds, user should make a choice and click/touch.
Then combined solution, arduino can be connected to computer and when someone clicks, arduino stops blinking image and notifies program, which does what it needs. Then when program is ready to blink another image, it shows blank screen, notifies arduino to start blinking again and then shows image. Cycle repeats. If you need better responses, you should provide more data about what is required, what you need to measure.