So I have been working on getting two Arduinos to talk to each other. I have two buttons connected to Arduino 1 and then two LED's Connected too Arduino 2. I hope to push a button and have one LED light up.
I would like to know where I am going wrong in this code as to me it seems like it should be working.
This is the code I have at the moment and I can send a bad schematic if you need it.
Ahh, I didn't notice the pin numbers being wrong.
So taking out the delays, and correcting the pin numbers, it is still not working.
By not working I mean nothing happens. Like nothing at all.
I have it wired up using the TX and RX pins on my two Arduino Uno's. Other than that, the LED's are just connected to the ground and their pin and the buttons are wired the same just on the other Arduino.
Thank you for your help so far, I have made more progress in the past hour than I had over the whole weekend
I had not connected the ground.
I did just there and one of the LED's lit up but did not turn off again.
Then, I reset it, uploaded the code again and it did not work again.
Another thing that might be important is that when I open the serial monitor for the sender sketch, it just sends out a stream of "ababababa" without me pressing any buttons. Does this matter or anything?
Okay, so I actually have it working now for the most part. The only small problem is that the LED's start up on and when the button is pressed they turn off, instead of the other way around. I don't know if this has to do with the Arduino Uno having pins set to HIGH automatically or something. But I did try putting "digitalWrite(LED1, LOW);" and "digitalWrite(LED2, LOW);" at the start but this didn't change anything. I don't think that was the right thing to do though honestly. I know that if a pin is output is it set to 3.3V or 5V for HIGH but not sure how to change this to LOW instead.
However it is now practically working so that's great