RadioHead library with no transmitter attached

I am just getting back into Arduino after a few years away and having fun. I am interested in a little RF project and bought a receiver/transmitter. However, I am confused by my very first step, before I even hook anything up :slight_smile:

I have installed the RadioHead library and I am using the RF_ASK.H driver.

I call driver.init() on my setup() method and receive back True. So far so good. Then I call this code in my loop()

bool sendResult = false;
bool waitResult = false;
sendResult = driver.send((uint8_t *)msg, strlen(msg));
waitResult = driver.waitPacketSent();

Both sendResult and waitResult return True, every time. Also, driver.txGood() returns an incrementing number each time, within my loop.

It's all good - except that this is with no transmitter attached to my Arduino Micro.

I am obviously missing something pretty basic here, but I would have assumed at least one of the methods I call would have returned False with no transmitter attached.

Can someone put me out of misery? :slight_smile:

Please edit your post to include the complete code, enclosed in code tags.

The RadioHead library has no method to determine whether a transmitter (or anything else) is attached to an output pin. In fact, the Arduino has no simple way of knowing, either.

If you have a radio that is capable of bidirectional communications via UART, I2C or SPI, then a response might be expected to verify proper initialization. But you forgot to tell us which radio you have, and to post a wiring diagram.

Thank you for the response, @jremington. Actually, the penny dropped as soon as I read you response. On reflection, the Arduino, through RadioHead, is merely outputting to a data pin, with no handshaking or protocol.

I made the basic (and incorrect) assumption that of the four methods I was calling at least one of them would involve interaction (as in back-and-forth) with the physical device. But as I now realize, it's nothing more than sending data to a pin and, since there's no bidirectional communication over that pin it's "blindly" sending that data, with no idea whether a transmitter is there to consume that data.

Thank you for the clarification.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.