I am new to the RFM69 and I am trying to use it with a NODE MCU ESP8266, but I cannot get it to compile. Am I missing a declaration or something?
#include <RFM69.h>
#include <SPIFlash.h>
#include <SPI.h>
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
//#include <LowPower.h>
SoftwareSerial ss(12, 13);
TinyGPSPlus gps; //Creates a GPS object
#define IS_RFM69HW_HCW;
#define NETWORKID = 10;
#define MYNODEID = 1;
#define TONODEID = 2;
#define FREQUENCY RF69_915MHZ;
#define ENCRYPT true;
#define ENCRYPTKEY "Track";
#define USEACK true;
RFM69 radio;
double setLat; //Variable for storing the set point latitude
double setLon; //Variable for storing the set point longitude
double compLat; //Variable for storing the compared latitude
double compLon; //Variable for storing the compared longitude
const int pot = 0; //The potientiometer is on Analof Pin 0
int D; //Variable for stoeing distance
int setD;
int potVal; //Variable doe storing the potentiometer reading
int condition = 0;
int lastCondition = 0;
int valD;
void setup() {
Serial.begin(9600);
ss.begin(9600);
radio.initialize(FREQUENCY, MYNODEID, NETWOEKID);
radio.setHighPower();
if(ENCRYPT)
radio.encrypt(ENCRYPTKEY);
}
void loop() {
if (setD == 0)
{
valD=analogRead(pot);
setD=map(valD, 4, 1024, 10, 90);
while (ss.available() > 0)
if (gps.encode(ss.read()))
{
if (gps.location.isValid())
{
setLat=gps.location.lat();
setLon=gps.location.lng();
condition = 1;
radio.sendWithRetry(TONODEID, &condition, 1);
}
}
}
while (ss.available() > 0)
if (gps.encode(ss.read()))
{
if (gps.location.isValid())
{
compLat=gps.location.lat();
compLon=gps.location.lng();
D=gps.distanceBetween(compLat, compLon, setLat, setLon); //Calculate delta distance
if (setD <= D)
{
condition = 3;
}
else
{
condition = 2;
}
Serial.flush();
}
}
if (lastCondition != condition)
{
radio.sendWithRetry(TONODEID, &condition, 1);
}
lastCondition = condition;
}