Brain Computer Interface Club Needs a Programmer

The brain computer interface club needs a programmer to code a very simple web app which can quickly display multiple strobes. I’ve already shown them this prototype and they need someone to expand it.

Contact Jenny Liu for more information yjialiu@gmail.com

Here’s the modified code:

<!DOCTYPE html>
<html>
<title>Flashing Page</title>
<script>
//Flashes Every 100 ms (0.1 seconds)
setInterval('flasher()', 100);
var flash = 0;
//Flash Function
function flasher(){
//Atomic Flash
	if(flash ==  0){
		document.bgColor = '#FF0000';
		flash = 1;
	} else {
		document.bgColor = '#FFFFFF';
		flash = 0;
	}
}
</script>
</html>

3 Responses to Brain Computer Interface Club Needs a Programmer

  1. thdeck says:

    I was thinking a bit about this problem yesterday, and I realized that there might be a problem with going the HTML route. I don’t know what kind of frequencies are required for the interface, but browsers typically clamp the minimum Javascript intervals to a particular value, often something around 10-15ms. Also, you’re not guaranteed much precision; I think the browser just guarantees that the event will execute after that interval has expired. Since there’s only one JS thread running at a time, the interval values will probably start to skew once you increased the number of different blinkies on the page.

  2. YJL says:

    Troy, the range of frequencies required is at worst less than 50 Hz. Most likely, we’ll be below 20 20 Hz, so the minimum time gives plenty of wiggle room.

    • thdeck says:

      That’s awesome news, because the web approach wins on all other counts. As Jared demonstrated, getting it up and running requires comparatively little code, and it’s hard to beat the portability of JavaScript.

Leave a Reply