Comunicating woth two ATMEGA88 chips RS232

I need help in sending date from a master and slave Atmel88 chip. I have completed the RS232 already and it works but I can only send one Bit. How can I send 8 I/O digital bits and 6 analogue bits so the slave Atmel can understand it?

Here is the code that works with one bit.

/*

  • Program for check analog and digital input for joystick
    Swap Jumper Number 9 Because we need to use this pin for input*
  • Function : Read Analog and Digital to Display to RS232
    */
    #define ledPin 13
    void setup() //Setup Function
    {
    Serial.begin(19200); //Initial RS232 Baud = 19200
    Serial.println("Please enter text");
    pinMode(ledPin, OUTPUT);
    digitalWrite(ledPin,LOW);
    }

void loop() //Main Function
{

if (Serial.available() > 0)
{
int var = Serial.read();
if (var ==0x31)
{
digitalWrite(ledPin,HIGH);
}else if (var !=0x31)
{
digitalWrite(ledPin,LOW);
}
}
}

Here is the slave code.

  • Program for check analog and digital input for joystick
    Swap Jumper Number 9 Because we need to use this pin for input*
  • Function : Read Analog and Digital to Display to RS232
    */
    #define ledPin 13
    void setup() //Setup Function
    {
    Serial.begin(19200); //Initial RS232 Baud = 19200
    Serial.println("Please enter text");
    pinMode(ledPin, OUTPUT);
    digitalWrite(ledPin,LOW);
    }

void loop() //Main Function
{

if (Serial.available() > 0)
{
int var = Serial.read();
if (var ==0x31)
{
digitalWrite(ledPin,HIGH);
}else if (var !=0x31)
{
digitalWrite(ledPin,LOW);
}
}
}

As said this code works. But how do I send 8 I/O digital pin data and 6 analogue so the other processor understands it?

Thanks

LOOK YOU HAVE POSTED THE SAME QUESTION IN 3 DIFFERENT SECTIONS OF THE FORUM.

DON'T DO IT AND USE THE # BUTTON WHEN POSTING CODE.
NOW GO AND DELETE THOSE EARLIER POSTS.

LOOK YOU HAVE POSTED THE SAME QUESTION IN 3 DIFFERENT SECTIONS OF THE FORUM.

DON'T DO IT AND USE THE # BUTTON WHEN POSTING CODE.
NOW GO AND DELETE THOSE EARLIER POSTS.

You got there first...

I was going to be slightly less shouty :stuck_out_tongue: