I am not really 100% too sure how to do this but I am trying to make my arduino UNO communicate with my arduino MEGA. The reason why I needed to do this was because I was using the RFID module along with a TFT display and the problem I faced is that on the arduino mega they both needed pin 53. Luckily I have an arduino UNO so I just went for that instead for the display. I am trying to use the analogWrite()
function to send analog signals from my MEGA over to the UNO so that the TFT display on the UNO can display the results. The UNO would also read the analog inputs coming from the MEGA. This did not work very well. The analog inputs are being sent from the MEGA but the UNO is not reciving them. I am using a PWN pin on the MEGA to send the analog output to the UNO.
This diagram shows what I mean:
These are the 2 compotents I am using:
https://i.stack.imgur.com/CqXdB.png TFT display
RFID
This shows how the libary sets out the pins. I am only a beginner so I personally don't want to mess around with the libary.
#define SS_PIN ...
in them where you can change the pin that you want to use instead of 53. The constructor hasMFRC522 mfrc522(SS_PIN, RST_PIN)
where you can put any pin numbers you like (or just redefine the macros to be something else).