Send the pulse data from arduino1 to arduino2 not working!!


Hi, all
I like'd to setting some pulse data on "Arduino1(digitalWrite pin 10)" and send to "Arduino2(pulseIN pin 9)" , but not working with "Arduino2" that can't detect(receive) any pulse data from "Arduino1(HIGH & LOW)" , so , it's possible to implement in such way??

sorry for my poor English... =(

thanks.. :slight_smile:

here my test code

int incomingByte,lastin;
unsigned long duration;
void setup(){
  Serial.begin(9600);
  pinMode(13,OUTPUT);
  pinMode(2,INPUT);
}

void loop(){
   
     if (Serial.available() > 0) { 
        incomingByte = Serial.read();
        if(incomingByte != lastin){
            if(incomingByte == 97){
                digitalWrite(13,HIGH);
                delay(10);
                digitalWrite(13,LOW);
                delay(10);    
                digitalWrite(13,HIGH);
                delay(10);
                digitalWrite(13,LOW);
                delay(10);    
            }else if(incomingByte == 115){
                  digitalWrite(13,HIGH);
                  delay(10);
                  digitalWrite(13,LOW);
                  delay(10);
            }
        }
    }    
    duration = pulseIn(2,HIGH);
    Serial.println(duration);
   lastin = incomingByte;
  
  
}

Do you have the grounds on each Arduino connected?

lar3ry : Yes, all grounds, it works on " digitalread(2) " receive 1 0 1 0 1 0 ...., but not work "pulseIn" detect... :astonished: