TomGeorge:
Hi,
In your code you are missing a lot of statements needed in void setup().Such as statements to declare your data in and out pins.
Check the code here;
https://www.instructables.com/id/RF-315433-MHz-Transmitter-receiver-Module-and-Ardu/
Tom...
I tried this , and many other codes existing on the internet. It didn't work out.