sending a train of data through digital I/O pins

Hi, I am using an arduino UNO to communicate wireless to another board and my RF module does the encoding and decoding on its own. It has 4 data lines and i need to transmit 8 different data through them.

I tried writing analog data to the lines and it wouldn't work.

Now i am trying to send a train of data bytes (binary) through the digital pins one after the other example for action 1, the code can be 101. So the digitalpin quickly sends 1,0,1 through the module and to the other board where i gather all the bits together and perform the required task!

The digitalWrite takes a long time to do this. For sending in three different commands, there is bound to be lots of lag. Any other way possible? I have read somewhere that bitset works but i cannot find how.

Using what code?

How to use this forum

I have the code for the analogWrite, but that is of no use at all. The seperate digitalWrite is given below as

int s=9;
void setup()


void loop()
  digitalWrite(s, LOW);
void turn_left()

the other codes which i actually think might work, are yet to be figured out!

Your problem is not that you are taking too long to send that bit stream but you are sending it too quickly. The transmit module will only be able to cope with slowly changing signals because the transmitter does not have the bandwith for fast ones.

Anyway you can't just transmit that and expect to be able to sort it out at the other end.

You need something like this:-

The encoder chip used has this datasheet:

It looks like the module will transmit continuously, so if you can figure out the cycle time through the 4 inputs you can ensure you don't change the inputs too quickly.

You'll have to build some sort of protocol on top of what the chip provides, its merely an IR remote encoder/decoder pair with 4 input channels. Think of it as 4 slow virtual wire connections.

More importantly though theses modules seem not to have the band/frequency labelled, so cannot legally be operated until you determine what band they use and whether that band is legal in your territory. Well I can't see that information in the eBay link...