Sunday, January 20, 2013

EEG and Cairo

Using the outline in this video:
http://www.youtube.com/watch?v=ZmxmeRry2uY

And an arduino board from a friend, I plan to create a small program that will display the output of the eeg onto the screen.

As my recent kick is with C, I think I'll do that. My current plan is to create a couple different programs, one that handle the graphics and another that will handle getting information from the eeg. That way I can develop  one while I assemble the EEG. I think I'll be using Cairo Graphics or OpenGL not sure which yet, I've selected Cairo because it seems like its easy to work with from the examples I've seen. And then I'll have a memory mapped file, or named pipe between the two programs so that they can share data quickly and efficiently.

http://www.linuxquestions.org/questions/programming-9/mmap-tutorial-c-c-511265/

Hopefully this all works out nicely, and if I don't manage to assemble an EEG, then at least I've worked with graphics and memory mapped files. Which I think could become a key staple to learning some parrallel processing techniques.

Thursday, January 17, 2013

Brain Fuck Interpreter. I made one

https://github.com/EJEHardenberg/BF_Interpret

So After a couple of days I've scrapped together my small amount of knowledge of C and created a BrainFuck interpreter.

It was pretty simple since all you're really doing is manipulating a Turing Machine. But creating the interactive bits was fun and a good thought exercise.

There are a few ways to run it once you've compiled it.

Just run it with no arguments:
Gets you the interpreter. Where you can type in all the BF commands you'd like, or comments as long as they don't include 'q' becuase 'q' is the quit key.

arguments of -f filename will read in a file and that file will be fed to the BF translator and outputted according to whatever program you decide.

arguments of anything else: will be taken as BF code and interpreted.

It's a pretty basic program, but it was a good exercise, and I'm going to refactor the code a bit. A friend of mine pointed out that the headers should be just declarations and not full blown source code.