Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: error while using SoftwareSerial on teensy 4.0

  1. #1
    Junior Member
    Join Date
    Sep 2019
    Posts
    1

    error while using SoftwareSerial on teensy 4.0

    Hi everyone,

    when I type
    Code:
    #include <SoftwareSerial.h>
    then I run my code I get this weird error that states:

    Code:
    error: 'Serial8' was not declared in this scope
    
       port = &Serial8;
    
               ^
    I haven't even initialized a SoftwareSerial object yet and I am getting this error so I am very confused. when I comment out the #include line out of my code, it works perfectly fine. I didn't know what was wrong so i uninstalled arduino and everything and reinstalled it but I still got the same error. If anyone has had a similar thing happen to them please help me out.

    thanks

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,597
    Looks like a bug in SoftwareSerial... In particular

    Serial8 existed in the T4 beta 1 board, but not in the Beta 2 board... So looks like we need to update it here... I will try to get in a Pull Request to fix.

    But until then you can edit your softwareSerial.cpp I believe lines 74-76
    Code:
    	} else if (rxPin == 30 && txPin == 31) {
    		port = &Serial8;
    		return;
    Simply delete those 3 lines of code...

    EDIT:
    Also required a change to .h file as well as we did not update a #if to apply to 1062 chips as well


    Did Pull Request: https://github.com/PaulStoffregen/SoftwareSerial/pull/7

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •