Hi,
I want make a wirelles Temp sensor usin Arduino,Dallas temp sensor and HM-T868S as Transmitter (HM-R868S as receiver). But when I write program (I'm using HopeRF library by Mikem) it says error message:
C:\Program Files (x86)\Arduino\libraries\HopeRF\HRFMessage.cpp: In function 'uint16_t hrf_crc(uint8_t*, uint8_t)':
C:\Program Files (x86)\Arduino\libraries\HopeRF\HRFMessage.cpp:22: error: '_crc_ccitt_update' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\HopeRF\HRFMessage.cpp: In member function 'virtual uint8_t HRFMessage::send(uint8_t*, uint8_t)':
C:\Program Files (x86)\Arduino\libraries\HopeRF\HRFMessage.cpp:49: error: '_crc_ccitt_update' was not declared in this scope
My code:
#include <OneWire.h>
#include <DallasTemperature.h>
#include <HRFMessage.h>
// Declare the HRFMessage to use Serial for IO with the HM-TR module
HRFMessage client(&Serial);
long lastSendTime = 0;
//Define Sensor
#define ONE_WIRE_PIN 8
OneWire oneWire(ONE_WIRE_PIN);
DallasTemperature sensors(&oneWire);
void setup()
{
Serial.begin(9600); //Begin communication
sensors.begin(); //Begin sensor
}
void loop()
{
//Get temp from Dallas sensor
sensors.requestTemperatures();
char C = sensors.getTempCByIndex(0);
// Send a message to the server at most once a second
long thisTime = millis();
if (thisTime > lastSendTime + 1000)
{
client.send((uint8_t*)C, 6); // Includes the NUL at the end of the string
lastSendTime = thisTime;
}
}