pouriap / TinyRF

A small Arduino library for using 315MHz / 433MHz RF modules with ATtiny13 and other low-memory microcontrollers.
GNU General Public License v3.0
64 stars 11 forks source link

TinyRF85 example does not compile #11

Open themelispan opened 1 year ago

themelispan commented 1 year ago

I tried compiling the TinyRF85 Receiver example with board "Digispark (Default - 16.5MHz)" which is my digispark ATtiny85 board. I chaged the line #include to #include 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

pouriap commented 1 year ago

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
themelispan commented 1 year ago

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

pouriap commented 1 year ago

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