I currently use Arduino IDE to program Raspberry Pico, using this as reference. Arduino-pico Github
My intention, is to use RadioHead library which is not available in MicroPython, to send and receive RF messages through cheap China RF modules.
I used the example code of the RH_ASK library as below, but I cannot see any results printed. Does anyone has tried this? Am I using something wrong? I have connected RF modules on UART0 pins.
#include <RH_ASK.h>
#ifdef RH_HAVE_HARDWARE_SPI
#include <SPI.h> // Not actually used but needed to compile
#endif
//RH_ASK driver;
RH_ASK driver(2000, 13, 12);
// RH_ASK driver(2000, 3, 4, 0); // ATTiny, RX on D3 (pin 2 on attiny85) TX on D4 (pin 3
on attiny85),
// RH_ASK driver(2000, PD14, PD13, 0); STM32F4 Discovery: see tx and rx on Orange and
Red LEDS
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()
{
uint8_t buf[RH_ASK_MAX_MESSAGE_LEN];
uint8_t buflen = sizeof(buf);
if (driver.recv(buf, &buflen)) // Non-blocking
{
driver.recv(buf, &buflen);
int i;
// Message with a good checksum received, dump it.
driver.printBuffer("Got:", buf, buflen);
}
}
Thank you in advance