Compilation error for Arduino Uno WiFi Rev2.
I want to upload to Arduino Uno WiFi Rev2. transmitter program code and I get errors. Similar errors were popping up in the older radio library <VirtualWire.h>
after installing the <RH_ASK.h> library, I still can't upload the code. Somewhere I read to switch to the newer RadioHead library and a button from it. On Arduino Uno other programs work for me.
I also have an Arduino UNO and there is no problem with playing the transmitter code on it.
Program code:
#include <RadioHead.h>
#include <radio_config_Si4460.h>
#include <RHCRC.h>
#include <RHDatagram.h>
#include <RHGenericDriver.h>
#include <RHGenericSPI.h>
#include <RHHardwareSPI.h>
#include <RHMesh.h>
#include <RHNRFSPIDriver.h>
#include <RHReliableDatagram.h>
#include <RHRouter.h>
#include <RHSoftwareSPI.h>
#include <RHSPIDriver.h>
#include <RHTcpProtocol.h>
#include <RH_ASK.h>
#include <RH_NRF24.h>
#include <RH_NRF905.h>
#include <RH_RF22.h>
#include <RH_RF24.h>
#include <RH_RF69.h>
#include <RH_RF95.h>
#include <RH_Serial.h>
#include <RH_TCP.h>
#include <SPI.h> // Not actualy used but needed to compile
RH_ASK driver;
void setup()
{
pinMode(13,1);
Serial.begin(9600); // Debugging only
if (!driver.init())
Serial.println("init failed");
}
void loop()
{
uint8_t buf[12];
uint8_t buflen = sizeof(buf);
String x="";
String y="Turn LED OFF";
if (driver.recv(buf, &buflen)) // Non-blocking
{
int i;
// Message with a good checksum received, dump it.
Serial.print("Message: ");
x=((String)(char*)buf);
x.trim();
Serial.println(x+ " :"+x.length());
if(x=="Turn LED ON!")
{
Serial.println("true ");
digitalWrite(13,1);
}
else
{
digitalWrite(13,0);
}
}
}
Mistakes:
In file included from C:\Users\Lenovo T420S\Desktop\Arduino\KOMPILACJA\sketch_jan06a\sketch_jan06a.ino:22:0:
C:\Users\Lenovo T420S\Downloads\DS3231-1.1.0\libraries\RadioHead/RH_Serial.h:105:29: error: expected ')' before '&' token
RH_Serial(HardwareSerial& serial);
^
C:\Users\Lenovo T420S\Downloads\DS3231-1.1.0\libraries\RadioHead/RH_Serial.h:177:5: error: reference to 'HardwareSerial' is ambiguous
HardwareSerial& _serial;
^~~~~~~~~~~~~~
C:\Users\Lenovo T420S\Downloads\DS3231-1.1.0\libraries\RadioHead/RH_Serial.h:36:7: note: candidates are: class HardwareSerial
class HardwareSerial;
^~~~~~~~~~~~~~
In file included from C:\Users\Lenovo T420S\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/UART.h:27:0,
from C:\Users\Lenovo T420S\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/Arduino.h:140,
from sketch\sketch_jan06a.ino.cpp:1:
C:\Users\Lenovo T420S\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/HardwareSerial.h:87:7: note: class arduino::HardwareSerial
class HardwareSerial : public Stream
^~~~~~~~~~~~~~
exit status 1
Błąd kompilacji dla płytki Arduino Uno WiFi Rev2. //PL
Compilation error for Arduino Uno WiFi Rev2. // ANG
Please help. Whether the library <RadioHead.h> is not working on Arduino Uno WiFi Rev2. ?




