I have trouble compiling this sketch. The error I get is

'SoftwareSerial' does not name a type

Any ideas how could I fix it?

#include SoftwareSerial.h

SoftwareSerial mySerial(10, 11); // RX, TX

void setup()
  // Open serial communications and wait for port to open:
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only


  // set the data rate for the SoftwareSerial port

  // for HC-05 use 38400 when poerwing with KEY/STATE set to HIGH on power on

void loop() // run over and over
  if (mySerial.available())
  if (Serial.available())
  • After doing this, I find that SoftwareSerial has a problem in it. Simply by coding #include "SoftwareSerial.h" and not even doing this: //SoftwareSerial Serial(RX, TX); Without SoftwareSerial, I have no idea where to get the output. It does not seem to want to send it to the Serial monitor. That's because there is no Port to select. So I am still stuck. I still get this error: C:\Users\mikey\Documents\Arduino\libraries\attiny_software_serial-master/SoftwareSerial.h:70:17: error: redeclaration of C++ built-in type 'bool' [-fpermissive] typedef uint8_t bool; Commented Jul 12, 2018 at 7:56

3 Answers 3


Add to @geometrikal.


#include <SoftwareSerial.h>

You forgot the quotation marks, try

#include "SoftwareSerial.h"
#include "SoftwareSerial.h" worked instead of 

#include <SoftwareSerial.h> ie " " not <>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.