2wire signals

i am trying to send signals from a arduino mini to a UNO useing 2 wires wire#1 is the signal wire wire#2 is connected to ground.
how can i do this?

I'd stop now before you damage something, and tell us exactly what is connected to what.

wire2 is connected to ground
and i dont know whare to plugin wire1

legoaceking:
i am trying to send signals from a arduino mini to a UNO useing 2 wires wire#1 is the signal wire wire#2 is connected to ground.
how can i do this?

You could can connect the TX pin of the Mini to the RX pin of the Uno. THen connect the Ground pin of the Mini to the Ground pin of the Uno. Use Serial.print() on the Mini and Serial.read() on the Uno.

trying that can you look at my code and tell me whats wong

the code for the controler

/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.

This example code is in the public domain.
*/

void setup() {
// initialize the digital pin as an output.
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps // Pin 13 has an LED connected on most Arduino boards:

}

void loop() {
Serial.print("100");
delay(1000); // wait for a second
Serial.print("001");
delay(1000); // wait for a second
}

and the code for the robot

int button1State = 0;
const int button1 = 2;
int command = 000;

void setup() {
const int button1 = 2;

Serial.begin(9600); // opens serial port, sets data rate to 9600 bps

pinMode(13,OUTPUT);
pinMode(3,OUTPUT);
pinMode(12,OUTPUT);
pinMode(11,OUTPUT);
pinMode(button1, INPUT);

}

void loop() {

delay(300000);

loop();{

command = Serial.read();

button1State = digitalRead(button1);

if (command == 100) {
// turn LED on:
digitalWrite(12,0); //start motor-B
analogWrite(11,255);

digitalWrite(13,0); //stop motor-A
analogWrite(3,0);

}
else {
}

if (command == 001) {
digitalWrite(12,0); //start motor-B
analogWrite(11,0);

digitalWrite(13,0); //stop motor-A
analogWrite(3,255);
}
else {
}

}

}

This part will delay for a VERY long time and then crash when the stack runs out of memory. I didn't read anything past this error.

void loop() {
  
  delay(300000);
  
  loop();

DO NOT CALL loop() FROM ANYWHERE IN YOUR SKETCH!

loop() gets called repeatedly after setup() finishes. Anything that should be done once at the beginning of the sketch should be done in setup(). Anything that has to be tried repeatedly, such as waiting for serial input, should be done in loop().

got rid of the loop will the program work?

will the program work?

No.

Serial.print("100");

This sends the characters '1', '0', and '0' to the serial port.

  command = Serial.read();

This reads one byte. The value in command will be -1, '1' or '0', depending on which pass through loop the read occurs on.

    if (command == 100) {

-1 is not 100, '1' is not 100, and '0' is not 100. So, this test will never be true.

      if (command == 001) {

-1 is not 1, '1' is not 1, and '0' is not 1. So, this test will never be true.

  else {
  }

The else block is not mandatory. Make it look like you know what you are doing and leave it out when there is nothing to do.

PaulS:

will the program work?

No.

Serial.print("100");

This sends the characters '1', '0', and '0' to the serial port.

  command = Serial.read();

This reads one byte. The value in command will be -1, '1' or '0', depending on which pass through loop the read occurs on.

    if (command == 100) {

-1 is not 100, '1' is not 100, and '0' is not 100. So, this test will never be true.

      if (command == 001) {

-1 is not 1, '1' is not 1, and '0' is not 1. So, this test will never be true.

  else {

}



The else block is not mandatory. Make it look like you know what you are doing and leave it out when there is nothing to do.

this look ok?

void setup() {                
  
Serial.begin(9600);	// opens serial port, sets data rate to 9600 bps  // Pin 13 has an LED connected on most Arduino boards:
 
}

void loop() {
Serial.print(1);
  delay(1000);              // wait for a second
Serial.print(0);
  delay(1000);              // wait for a second
}
int button1State = 0;
const int button1 = 2;
int command = 0;

void setup() {     
const int button1 = 2;


Serial.begin(9600);	// opens serial port, sets data rate to 9600 bps

pinMode(13,OUTPUT);
pinMode(3,OUTPUT); 
pinMode(12,OUTPUT);
pinMode(11,OUTPUT); 
pinMode(button1, INPUT);


}

void loop() {
    
  command = Serial.read();

  button1State = digitalRead(button1);
  
    if (command == 0) {     
    // turn LED on:    
digitalWrite(12,0); //start motor-B
analogWrite(11,255);

digitalWrite(13,0);  //stop motor-A
analogWrite(3,0);

  }
  
      if (command == 1) {     
        digitalWrite(12,0); //start motor-B
analogWrite(11,0);

digitalWrite(13,0);  //stop motor-A
analogWrite(3,255);
  } 
  
}
Serial.print(1);

No. You are trying to read binary data. You must send binary data to be read.

Serial.write((byte)1);

it works!
thank you guys so much!