Please don't dump on me about it's speed, I know it will be slow. But i'm just doing a really quick proof of concept at the moment and a need a soft parallel port for a ks0108 display.
I've got a great working library for it that i've used over SPI using the netmf toolbox but this needs to be over gpio's.
this is what I've got but it is failing with a null reference exception at line 18, gosh i feel like a dummy.
{ public class SoftParallel { OutputPort[] bit_; public SoftParallel(OutputPort bit_0, OutputPort bit_1, OutputPort bit_2, OutputPort bit_3, OutputPort bit_4, OutputPort bit_5, OutputPort bit_6, OutputPort bit_7, bool invert) { if (!invert) { this.bit_[0] = bit_0; this.bit_[1] = bit_1; this.bit_[2] = bit_2; this.bit_[3] = bit_3; this.bit_[4] = bit_4; this.bit_[5] = bit_5; this.bit_[6] = bit_6; this.bit_[7] = bit_7; } else { this.bit_[0] = bit_7; this.bit_[1] = bit_6; this.bit_[2] = bit_5; this.bit_[3] = bit_4; this.bit_[4] = bit_3; this.bit_[5] = bit_2; this.bit_[6] = bit_1; this.bit_[7] = bit_0; } } public void Write(byte data) { for (int Counter = 0; Counter < 8; ++Counter) { bit_[Counter].Write(data.GetBit(Counter)); } } } }
thanks in advance.