2

Folks,

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)); driver.waitPacketSent(); delay(1000); }

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?

Ranjith

timemage
  • 5,639
  • 1
  • 14
  • 25
Ranjith
  • 61
  • 2

1 Answers1

2

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.

timemage
  • 5,639
  • 1
  • 14
  • 25