Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass
Created June 21, 2020 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffersGlass/67186cf663bb1dcc88ace005c98a6dea to your computer and use it in GitHub Desktop.
Save JeffersGlass/67186cf663bb1dcc88ace005c98a6dea to your computer and use it in GitHub Desktop.
#include <RH_ASK.h>
#ifdef RH_HAVE_HARDWARE_SPI
#include <SPI.h> // Not actually used but needed to compile
#endif
//RH_ASK driver; //Defaults to receive on pin D11 and transmit on pin 5
RH_ASK driver(2000, 4, 5, 0); //Bitrate, rx pin, tx pin, transmit controller pin
uint16_t value = 0;
void setup()
{
#ifdef RH_HAVE_SERIAL
Serial.begin(9600); // Debugging only
#endif
if (!driver.init())
#ifdef RH_HAVE_SERIAL
Serial.println("init failed");
#else
;
#endif
}
void loop()
{
value += 1234;
const uint16_t * msg = &value;
driver.send((uint8_t *)msg, 2);
driver.waitPacketSent();
//delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment