PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ask_transmitter.pde 655B

3 years ago
123456789101112131415161718192021222324252627
  1. // ask_transmitter.pde
  2. // -*- mode: C++ -*-
  3. // Simple example of how to use RadioHead to transmit messages
  4. // with a simple ASK transmitter in a very simple way.
  5. // Implements a simplex (one-way) transmitter with an TX-C1 module
  6. #include <RH_ASK.h>
  7. #include <SPI.h> // Not actually used but needed to compile
  8. RH_ASK driver;
  9. // RH_ASK driver(2000, 2, 4, 5); // ESP8266: do not use pin 11
  10. void setup()
  11. {
  12. Serial.begin(9600); // Debugging only
  13. if (!driver.init())
  14. Serial.println("init failed");
  15. }
  16. void loop()
  17. {
  18. const char *msg = "hello";
  19. driver.send((uint8_t *)msg, strlen(msg));
  20. driver.waitPacketSent();
  21. delay(200);
  22. }