Here is my code:
// ask_transmitter.pde
// -- mode: C++ --
// Simple example of how to use RadioHead to transmit messages
// with a simple ASK transmitter in a very simple way.
// Implements a simplex (one-way) transmitter with an TX-C1 module
#include "C:\Users\lherron8\Desktop\RadioHead-master\RH_ASK.h"
#include <SPI.h> // Not actually used but needed to compile
RH_ASK driver;
struct dataStruct{
float string;
unsigned long counter;
}myData;
byte tx_buf[sizeof(myData)] = {0};
void setup()
{
Serial.begin(9600); // Debugging only
if (!driver.init())
Serial.println("init failed");
myData.string = 10;
}
void loop()
{
memcpy(tx_buf, &myData, sizeof(myData) );
byte zize=sizeof(myData);
driver.send((uint8_t *)tx_buf, zize);
// driver.send((uint8_t *)msg, strlen(msg));
driver.waitPacketSent();
myData.counter++;
delay(2000);
}
Here are the errors I get:
Arduino: 1.6.5 (Windows 7), Board: "Arduino Mini, ATmega328"
ask_attempt.cpp.o: In function __static_initialization_and_destruction_0': C:\Users\lherron8\Desktop\arduino-1.6.5-r2/ask_attempt.ino:10: undefined reference to
RH_ASK::RH_ASK(unsigned int, unsigned char, unsigned char, unsigned char, bool)'
ask_attempt.cpp.o: In function setup': C:\Users\lherron8\Desktop\arduino-1.6.5-r2/ask_attempt.ino:24: undefined reference to
RH_ASK::init()'
ask_attempt.cpp.o: In function loop': C:\Users\lherron8\Desktop\arduino-1.6.5-r2/ask_attempt.ino:38: undefined reference to
RH_ASK::send(unsigned char const*, unsigned char)'
collect2.exe: error: ld returned 1 exit status
Error compiling.
I'm just attempting to send any piece of information from a transmitter to a receiver, but I'm not sure how to get rid of these errors. the "arduino-1.6.5-r2" file is the file downloaded from installing the file from the arduino website for the IDE and .ino sketch is the ask_attempt, even though it's located in the "C:\Users\lherron8\Desktop\RadioHead-master\examples\ask" directory.
If you need anymore information, let me know!