TinyRF icon indicating copy to clipboard operation
TinyRF copied to clipboard

TinyRF85 example does not compile

Open themelispan opened this issue 2 years ago • 3 comments

I tried compiling the TinyRF85 Receiver example with board "Digispark (Default - 16.5MHz)" which is my digispark ATtiny85 board. I chaged the line #include <SoftwareSerial.h> to #include <SoftSerial.h> because the compiler thought it should use the ESP8266/ESP32 SoftwareSerial library. Still, I am getting the error 'SoftwareSerial' does not name a type.

C:\Users\theme_9p6cezr\OneDrive\Arduino\Tiny85_RC_car_receiver\Tiny85_RC_car_receiver.ino:13:1: error: 'SoftwareSerial' does not name a type SoftwareSerial mySerial(3, 4); //rx, tx ^ C:\Users\theme_9p6cezr\OneDrive\Arduino\Tiny85_RC_car_receiver\Tiny85_RC_car_receiver.ino: In function 'void setup()': C:\Users\theme_9p6cezr\OneDrive\Arduino\Tiny85_RC_car_receiver\Tiny85_RC_car_receiver.ino:31:3: error: 'mySerial' was not declared in this scope mySerial.begin(115200); ^ C:\Users\theme_9p6cezr\OneDrive\Arduino\Tiny85_RC_car_receiver\Tiny85_RC_car_receiver.ino: In function 'void loop()': C:\Users\theme_9p6cezr\OneDrive\Arduino\Tiny85_RC_car_receiver\Tiny85_RC_car_receiver.ino:54:5: error: 'mySerial' was not declared in this scope mySerial.println("Buffer too small for received data!"); ^ C:\Users\theme_9p6cezr\OneDrive\Arduino\Tiny85_RC_car_receiver\Tiny85_RC_car_receiver.ino:59:5: error: 'mySerial' was not declared in this scope mySerial.println("Received corrupted data."); ^ C:\Users\theme_9p6cezr\OneDrive\Arduino\Tiny85_RC_car_receiver\Tiny85_RC_car_receiver.ino:66:5: error: 'mySerial' was not declared in this scope mySerial.print("Received: "); ^

exit status 1

Compilation error: 'SoftwareSerial' does not name a type

themelispan avatar Jun 30 '23 14:06 themelispan

I haven't used that library but I guess you should change the line

SoftwareSerial mySerial(3,4);  //rx, tx

to

SoftSerial mySerial(3,4);  //rx, tx

pouriap avatar Jul 01 '23 15:07 pouriap

I tried it, it doesn't work. It will only compile if I comment out all serial-related commands

themelispan avatar Jul 05 '23 10:07 themelispan

Does the library have an example sketch? Does the example sketch compile?

pouriap avatar Jul 05 '23 17:07 pouriap