The ATTiny85 can run RadioHead ASK. it’s tricky but it works. This code is from the Arduino IDE and it compiles there, with a few warnings. In platformio, it results in an error. My guess is it sticks to hardware SPI while Arduino IDE works around it.
Or it has something to do with the fuses setting, I tried to figure out how to switch ‘cores’ but did not succeed. It looks like platformio uses Arduino TinyCore and that is the right one anyway.
#include <RH_ASK.h>
#define R_PIN PB4
#define T_PIN PB1
#define L_PIN PB3
RH_ASK driver(2000, R_PIN, T_PIN);
void setup()
{
if (!driver.init()){
pinMode(L_PIN, OUTPUT);
digitalWrite(L_PIN, HIGH);
delay(500);
digitalWrite(L_PIN, LOW);
delay(500);
}
}
void loop()
{
const char *msg = "hello";
driver.send((uint8_t *)msg, strlen(msg));
driver.waitPacketSent();
delay(200);
}
config
[env:myenv]
platform = atmelavr
framework = arduino
board = attiny85
upload_protocol = stk500v1
upload_flags = -P$UPLOAD_PORT -b$UPLOAD_SPEED
upload_port = /dev/ttyUSB0
upload_speed = 19200
lib_deps =
RadioHead
Due to some poor choices in forum configuration, it is not possible for me to attach the log results from compiling