There is a document named "Complete Guide for RF 433MHz Transmitter.pdf" available in the GitHub.

There is a a connection diagram showing the Data pin of the Transmitter connected to the pin 12 of the Arduino Uno.

The Transmitter sketch given in it is as follows:

#include <RH_ASK.h>
#include <SPI.h> // Not actually used but needed to compile

RH_ASK driver;

void setup()
 Serial.begin(9600); // Debugging only
 if (!driver.init())
 Serial.println("init failed");

void loop()
 const char *msg = "Hello World!";
 driver.send((uint8_t *)msg, strlen(msg));

There is no mention of Pin 12 as part of the sketch. I am not sure how the Arduino knows the Transmitter Data input is connected to the Pin 12? Can someone please help?



In RH_ASK.h is:

RH_ASK(uint16_t speed = 2000, uint8_t rxPin = 11, uint8_t txPin = 12, uint8_t pttPin = 10, bool pttInverted = false);

So the argument has a default value specified here. If you don't specify it, it assumes that default.

  • Thanks a lot. Much appreciated. – Ranjith Dec 28 '20 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.