Hello everyone!
I am trying to communicate the SX1278 LoRa 433MHz Ra-02 module with attiny85 in my project. But I'm getting the errors during compilation:
F:\Arduino\libraries\LoRa\src/LoRa.h:77:15: error: 'SPIClass' has not been declared
void setSPI(SPIClass& spi);
^
F:\Arduino\libraries\LoRa\src/LoRa.h:101:3: error: 'SPIClass' does not name a type
SPIClass* _spi;
I'm using AttinyCore (available at: GitHub - SpenceKonde/ATTinyCore: Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8), Arduino IDE in version 1.8.9 and my tests are based on the LoraReceiver example from the arduino-LoRa library (available at: GitHub - sandeepmistry/arduino-LoRa: An Arduino library for sending and receiving data using LoRa radios.), follow the example code snippet:
#include <SPI.h>
#include <LoRa.h>
int counter = 0;
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("LoRa Sender");
if (!LoRa.begin(433E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}
}
void loop() {
Serial.print("Sending packet: ");
Serial.println(counter);
// send packet
LoRa.beginPacket();
LoRa.print("hello ");
LoRa.print(counter);
LoRa.endPacket();
counter++;
delay(5000);
}
Thanks any help!