Hi,
I have been trying to compile RadioHead send example but I am getting many errors(
error: 'uint8_t' does not name a type).
It seems like there is a bug in the new RadioHead.
I found in my downloads an older version RadioHead-1.84 which does not give me those errors(ofcourse i removed the serial.begin etc) but many other errors. Some of them are:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:146:16: error: 'SPE' was not declared in this scope
spcr = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) |
^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:217:14: error: 'SPSR' was not declared in this scope
while (!(SPSR & _BV(SPIF))) ; // wait
^~~~
C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:217:14: note: suggested alternative: 'ACSR'
while (!(SPSR & _BV(SPIF))) ; // wait
^~~~
ACSR
My code is:
// 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 <RH_ASK.h>
#include <SPI.h> // Not actually used but needed to compile
//RH_ASK driver;
RH_ASK driver(2000, 3, 4, 0);
void setup()
{
// Serial.begin(9600); // Debugging only
// if (!driver.init())
// Serial.println("init failed");
}
void loop()
{
const char *msg = "hello";
driver.send((uint8_t *)msg, strlen(msg));
driver.waitPacketSent();
delay(200);
}