So, say I had a clk, a cs, and a msio.
And inorder for the msio to transmit, I had to push clk and cs low.
would that mean?
var p3 = GT.Socket.GetSocket(9, false, null, null).CpuPins[3];
var p4 = GT.Socket.GetSocket(9, false, null, null).CpuPins[4];
var ClkPin = new OutputPort(p3, false);
var CsPin = new OutputPort(p4, false);
ClkPin.Write(True);
CsPin.Write(true);
WriteRead(bytes, bytes);
CsPin.Write(true);
ClkPin.Write(true);
for ->
digitalWrite(sclk, LOW);
_delay_ms(1);
digitalWrite(cs, LOW); _
delay_ms(1);
for (i=31; i>=0; i--)
{
digitalWrite(sclk, LOW);
_delay_ms(1);
d <<= 1;
if (digitalRead(miso))
{
d |= 1;
}
digitalWrite(sclk, HIGH);
_delay_ms(1);
}
digitalWrite(cs, HIGH);
Leaving out the naghty bits.
Is this right?
BTW running on a kind of SPI.
Thanks