No Such Libaries error in Arduino IDE 2.1.1

Hello,
I am attempting to adjust some code in Arduino IDE 2.1.1, and it calls for:

QueueArray.h
SoftwareSerial.h

it gives me the error that there is no such file or directory for the QueueArray.h and the SoftwareSerial gives:

Compilation error: call of overloaded 'BasicUART(SoftwareSerial)' is ambiguous

I have these libraries installed:
Adafruit Neopixel
Adafruit Soundboard Library
Audio Zero
EspSoftwareSerial
I2C
Queue
TaskQueue

What am I missing to not make this work? Please help me. And thank you in advance.

#include <SoftwareSerial.h>

#include <QueueArray.h>

#include <Wire.h> // Include the I2C library (required)

// for the sound board
#include <SoftwareSerial.h>
#include "Adafruit_Soundboard.h"

#include <Adafruit_NeoPixel.h>

// for led triggers
#define HIGH 0x1
#define LOW  0x0

// pins for 3 red leds
int LedA = A0;
int LedB = A1;
int LedC = A2;

// neopixel pins / setup
#define NEO_PIXELS 2
Adafruit_NeoPixel NeoPixels = Adafruit_NeoPixel(31, NEO_PIXELS, NEO_GRB + NEO_KHZ800);

// Index numbers for the LEDs in the neopixels. since i used 2 jewels for the center, one ring for the end, and a single for the indicator, 
//i set them as below. if you use a different number or type of pixels, change these numbers accordingly. the indicator light is first in the chain
//so it is number 0
int centerStart = 1;
int centerEnd = 14;
int ringStart = 15;
int ringEnd = 30;

// inputs for switches and buttons
const int SONGBTN = 5;
const int POWERSW = 6;
const int BLUEBTN = 7;
const int ORANGEBTN = 8;
const int CANCELBTN = 9;

// soundboard pins and setup
#define SFX_RST 10
#define SFX_RX 11
#define SFX_TX 12
const int ACT = 13;    // this allows us to know if the audio is playing

SoftwareSerial ss = SoftwareSerial(SFX_TX, SFX_RX);
Adafruit_Soundboard sfx = Adafruit_Soundboard( &ss, NULL, SFX_RST);

// Possible states
bool Firing = false;    // firing animation is going
bool Portal = false;  // is there an open portal
bool Power = false; // power on or off
bool Song = false; //playing the song

// audio track names on soundboard
char powerup[] =              "T00     WAV";
char hum[] =                  "T01     WAV";
char bluefire[] =             "T02     WAV";
char orangefire[] =           "T03     WAV";
char cancelportal[] =         "T04     WAV";
char powerdown[] =            "T05     WAV";
char alivesong[] =            "T06     OGG";


// Arduino setup function
void setup() {
  // softwareserial at 9600 baud for the audio board
  ss.begin(9600);

  // set act modes for the fx board
  pinMode(ACT, INPUT);
  pinMode(LedA, OUTPUT);
  pinMode(LedB, OUTPUT);
  pinMode(LedC, OUTPUT);

  // configure neo pixels
  NeoPixels.begin();
  NeoPixels.setBrightness(255);
  NeoPixels.show(); // Initialize all pixels to 'off'

  // set the modes for the switches/buttons
  pinMode(SONGBTN, INPUT);
  digitalWrite(SONGBTN, HIGH);
  pinMode(POWERSW, INPUT);
  digitalWrite(POWERSW, HIGH);
  pinMode(BLUEBTN, INPUT);
  digitalWrite(BLUEBTN, HIGH);
  pinMode(ORANGEBTN, INPUT);
  digitalWrite(ORANGEBTN, HIGH);
  pinMode(CANCELBTN, INPUT);
  digitalWrite(CANCELBTN, HIGH);
}

/* ************* Audio Board Helper Functions ************* */
// helper function to play a track by name on the audio board
void playAudio( char* trackname, int playing ) {
  // stop track if one is going
  if (playing == 0) {
    sfx.stop();
  }

  // now go play
  if (sfx.playTrack(trackname)) {
    sfx.unpause();
  }
}


/* ************* Main Loop ************* */

void loop() {
  // find out of the audio board is playing audio
  int playing = digitalRead(ACT);

  // get the current switch states
  int SongBtn = digitalRead(SONGBTN);

  // if you press song button play song
  if (SongBtn == 0) {
    if (Song == false) {
      playAudio(alivesong, playing);
      Song = true;
    }
  } else {
    Song = false;
  }

  int PowerSw = digitalRead(POWERSW);
  int BlueBtn = digitalRead(BLUEBTN);
  int OrangeBtn = digitalRead(ORANGEBTN);
  int CancelBtn = digitalRead(CANCELBTN);

  // while the startup switch is set on
  if (PowerSw == 0) {
    // play the hum sound when on and idle
    if (playing == 1 && Power == true) {
      playAudio(hum, playing);
    }
  }

  // if we are not powered up we should play the power up sound and begin the loop
  if (PowerSw == 0 && Power == false) {
    Power = true;
    analogWrite(LedA, 175); //turn led on
    analogWrite(LedB, 175); // turn led on
    analogWrite(LedC, 175); // turn led on
    playAudio(powerup, playing);
  }

  // if we are powered up and turn the power switch off then power down
  if (PowerSw == 1 && Power == true) {
    Power = false;
    playAudio(powerdown, playing);
    analogWrite(LedA, 0); //turn Led off
    analogWrite(LedB, 0); // turn led off
    analogWrite(LedC, 0); // turn led off
    setLightsState(2); //set blue or orange light to off
  }

  // Fire Blue
  if (BlueBtn == 0 && Power == true && Firing == false) {
    Firing = true;
    Portal = true;
    playAudio(bluefire, playing);
    setLightsState(1); //set light to blue

  } else {
    if (CancelBtn == 1 && BlueBtn == 1 && OrangeBtn == 1 && Firing == true)
      Firing = false;
  }

  // Fire Orange
  if (OrangeBtn == 0 && Power == true && Firing == false) {
    Firing = true;
    Portal = true;
    playAudio(orangefire, playing);
    setLightsState(0); //set lights to orange

  } else {
    if (CancelBtn == 1 && BlueBtn == 1 && OrangeBtn == 1 && Firing == true)
      Firing = false;
  }


  // Cancel Portal
  if (CancelBtn == 0 && Power == true && Firing == false && Portal == true) {
    Firing = true;
    Portal = false;
    playAudio(cancelportal, playing);
    setLightsState(2); //set light to off

  } else {
    if (CancelBtn == 1 && BlueBtn == 1 && OrangeBtn == 1 && Firing == true)
      Firing = false;
  }
}


/* ************* Lights States************* */
void setLightsState(int state)
{
  switch ( state )
  {

    case 0: // orange fire
      for (int d = 25, b = 25; (d > 0) && (b < 50); d--, b++) //starts at 50 percent, center light dims then brightens, end light brightens then dims
      {
        for (int j = centerStart; j <= centerEnd; j++)
        {
          NeoPixels.setPixelColor(j, NeoPixels.Color(d * 5, d, 0)); //i get orange to dim properly by setting green to a number and setting red to 5 times what green is
        }
        {
          for (int k = ringStart; k <= ringEnd; k++)
          {
            NeoPixels.setPixelColor(k, NeoPixels.Color(b * 5, b, 0));
          }
          NeoPixels.show();
          delay(0);
        }
      }
      for (int d = 0, b = 50; (d < 25) && (b > 25); d++, b--) {
        for (int j = centerStart; j <= centerEnd; j++) {
          NeoPixels.setPixelColor(j, NeoPixels.Color(d * 5, d, 0));
        }

        {
          for (int k = ringStart; k <= ringEnd; k++) {
            NeoPixels.setPixelColor(k, NeoPixels.Color(b * 5, b, 0));
          }

          NeoPixels.setPixelColor(0, NeoPixels.Color(255, 50, 0));
          NeoPixels.show();
          delay(20);
        }
      }
      break;

    case 1: // blue fire

      for (int d = 128, b = 128; (d > 0) && (b < 255); d--, b++)// same as orange above, except you just have to set blue between half and full
      {
        for (int j = centerStart; j <= centerEnd; j++)
        {
          NeoPixels.setPixelColor(j, NeoPixels.Color(0, 0, d));
        }
        {
          for (int k = ringStart; k <= ringEnd; k++)
          {
            NeoPixels.setPixelColor(k, NeoPixels.Color(0, 0, b));
          }
          NeoPixels.setPixelColor(0, 0, 0, 255);
          NeoPixels.show();
          delay(0);
        }
      }
      for (int d = 0, b = 255; (d < 128) && (b > 128); d++, b--) {
        for (int j = centerStart; j <= centerEnd; j++) {
          NeoPixels.setPixelColor(j, NeoPixels.Color(0, 0, d));
        }

        {
          for (int k = ringStart; k <= ringEnd; k++) {
            NeoPixels.setPixelColor(k, NeoPixels.Color(0, 0, b));
          }

          NeoPixels.setPixelColor(0, NeoPixels.Color(0, 0, 255));
          NeoPixels.show();
          delay(4);
        }
      }
      break;


    case 2: // set led off
      for (int j = 0; j < NeoPixels.numPixels(); j++) {
        NeoPixels.setPixelColor(j, 0);
      }
      break;
  }
  NeoPixels.show();
}

sounds like you need to install the QueueArray library
what arduino are you using?
have you got SoftwareSerial and EspSoftwareSerial libraries installed?
try changing

#include <EspSoftwareSerial.h>

I am using an Arduino Nano. I have been unable to upload the SoftwareSerial and the QueueArray library you provided. I will attempt to change to the suggestion.

EspSoftwareSerial for the ESP8266 microcontroller not the Nano
try AltSoftSerial
what was the problem downloading QueueArray?

I will attempt the AltSoftSerial.

The QueueArray , I had imported the library, restarted the IDE
software, but it gives the error

`/-Private File Info: fatal error: QueueArray.h: No such file or directory
#include <QueueArray.h>
^~~~~~~~~~~~~~
compilation terminated.

exit status 1

Compilation error: QueueArray.h: No such file or directory`

If I were to turn it off by // the line, the new error is:

WARNING: library AltSoftSerial claims to run on avr architecture(s) and may be incompatible with your current board which runs on esp32 architecture(s).
In file included from **Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:35:
**Private File Info**/Arduino/libraries/AltSoftSerial/config/AltSoftSerial_Boards.h:136:2: error: #error "Please define your board timer and pins"
 #error "Please define your board timer and pins"
  ^~~~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp: In static member function 'static void AltSoftSerial::init(uint32_t)':
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:74:3: error: 'CONFIG_TIMER_NOPRESCALE' was not declared in this scope
   CONFIG_TIMER_NOPRESCALE();
   ^~~~~~~~~~~~~~~~~~~~~~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:74:3: note: suggested alternative: 'CONFIG_BLE_SMP_ENABLE'
   CONFIG_TIMER_NOPRESCALE();
   ^~~~~~~~~~~~~~~~~~~~~~~
   CONFIG_BLE_SMP_ENABLE
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:79:4: error: 'CONFIG_TIMER_PRESCALE_8' was not declared in this scope
    CONFIG_TIMER_PRESCALE_8();
    ^~~~~~~~~~~~~~~~~~~~~~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:79:4: note: suggested alternative: 'CONFIG_TIMER_QUEUE_LENGTH'
    CONFIG_TIMER_PRESCALE_8();
    ^~~~~~~~~~~~~~~~~~~~~~~
    CONFIG_TIMER_QUEUE_LENGTH
In file included from **Private File Info**/Library/Arduino15/packages/arduino/hardware/esp32/2.0.11/cores/esp32/Arduino.h:223,
                 from **Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.h:30,
                 from **Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:34:
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:104:10: error: 'INPUT_CAPTURE_PIN' was not declared in this scope
  pinMode(INPUT_CAPTURE_PIN, INPUT_PULLUP);
          ^~~~~~~~~~~~~~~~~
**Private File Info**/Library/Arduino15/packages/arduino/hardware/esp32/2.0.11/cores/esp32/io_pin_remap.h:47:84: note: in definition of macro 'pinMode'
 #define pinMode(pin, mode)                          pinMode(digitalPinToGPIONumber(pin), mode)
                                                                                    ^~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:104:10: note: suggested alternative: 'INPUT_PULLDOWN'
  pinMode(INPUT_CAPTURE_PIN, INPUT_PULLUP);
          ^~~~~~~~~~~~~~~~~
**Private File Info**/Library/Arduino15/packages/arduino/hardware/esp32/2.0.11/cores/esp32/io_pin_remap.h:47:84: note: in definition of macro 'pinMode'
 #define pinMode(pin, mode)                          pinMode(digitalPinToGPIONumber(pin), mode)
                                                                                    ^~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:105:15: error: 'OUTPUT_COMPARE_A_PIN' was not declared in this scope
  digitalWrite(OUTPUT_COMPARE_A_PIN, HIGH);
               ^~~~~~~~~~~~~~~~~~~~
**Private File Info**/Library/Arduino15/packages/arduino/hardware/esp32/2.0.11/cores/esp32/io_pin_remap.h:46:89: note: in definition of macro 'digitalWrite'
 #define digitalWrite(pin, val)                      digitalWrite(digitalPinToGPIONumber(pin), val)
                                                                                         ^~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:105:15: note: suggested alternative: 'OUTPUT_OPEN_DRAIN'
  digitalWrite(OUTPUT_COMPARE_A_PIN, HIGH);
               ^~~~~~~~~~~~~~~~~~~~
**Private File Info**/Library/Arduino15/packages/arduino/hardware/esp32/2.0.11/cores/esp32/io_pin_remap.h:46:89: note: in definition of macro 'digitalWrite'
 #define digitalWrite(pin, val)                      digitalWrite(digitalPinToGPIONumber(pin), val)
                                                                                         ^~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:113:2: error: 'ENABLE_INT_INPUT_CAPTURE' was not declared in this scope
  ENABLE_INT_INPUT_CAPTURE();
  ^~~~~~~~~~~~~~~~~~~~~~~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp: In static member function 'static void AltSoftSerial::end()':
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:118:2: error: 'DISABLE_INT_COMPARE_B' was not declared in this scope
  DISABLE_INT_COMPARE_B();
  ^~~~~~~~~~~~~~~~~~~~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:119:2: error: 'DISABLE_INT_INPUT_CAPTURE' was not declared in this scope
  DISABLE_INT_INPUT_CAPTURE();
  ^~~~~~~~~~~~~~~~~~~~~~~~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:122:2: error: 'DISABLE_INT_COMPARE_A' was not declared in this scope
  DISABLE_INT_COMPARE_A();
  ^~~~~~~~~~~~~~~~~~~~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp: In static member function 'static void AltSoftSerial::writeByte(uint8_t)':
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:138:15: error: 'SREG' was not declared in this scope
  intr_state = SREG;
               ^~~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:138:15: note: suggested alternative: 'LBEG'
  intr_state = SREG;
               ^~~~
               LBEG
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:147:3: error: 'ENABLE_INT_COMPARE_A' was not declared in this scope
   ENABLE_INT_COMPARE_A();
   ^~~~~~~~~~~~~~~~~~~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:148:3: error: 'CONFIG_MATCH_CLEAR' was not declared in this scope
   CONFIG_MATCH_CLEAR();
   ^~~~~~~~~~~~~~~~~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:148:3: note: suggested alternative: 'CONFIG_STACK_CHECK'
   CONFIG_MATCH_CLEAR();
   ^~~~~~~~~~~~~~~~~~
   CONFIG_STACK_CHECK
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:149:17: error: 'GET_TIMER_COUNT' was not declared in this scope
   SET_COMPARE_A(GET_TIMER_COUNT() + 16);
                 ^~~~~~~~~~~~~~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:149:17: note: suggested alternative: 'ERR_TIMEOUT'
   SET_COMPARE_A(GET_TIMER_COUNT() + 16);
                 ^~~~~~~~~~~~~~~
                 ERR_TIMEOUT
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:149:3: error: 'SET_COMPARE_A' was not declared in this scope
   SET_COMPARE_A(GET_TIMER_COUNT() + 16);
   ^~~~~~~~~~~~~
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:149:3: note: suggested alternative: 'SCOMPARE1'
   SET_COMPARE_A(GET_TIMER_COUNT() + 16);
   ^~~~~~~~~~~~~
   SCOMPARE1
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp: At global scope:
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:155:4: error: expected constructor, destructor, or type conversion before '(' token
 ISR(COMPARE_A_INTERRUPT)
    ^
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:222:4: error: expected constructor, destructor, or type conversion before '(' token
 ISR(CAPTURE_INTERRUPT)
    ^
**Private File Info**/Arduino/libraries/AltSoftSerial/AltSoftSerial.cpp:275:4: error: expected constructor, destructor, or type conversion before '(' token
 ISR(COMPARE_B_INTERRUPT)
    ^

exit status 1

Compilation error: exit status 1


did you instal the library - see Add-libraries-to-Arduino-IDE section Importing a .zip Library
could you give more details of the project?
e.g. what you are attempting to do, what sensors/devoces you are usin and how they are connected, etc

I had followed the instructions, however, the Queue Array Library is only an .h file, not a .zip file. So thats definitely part of the issue. I will research another.

For my project, I am attempting to build a Arduino Portal Gun . Except I did adjust the diagram a bit in order to accommodate my needs for the gun. I had 5 working trials with the lights (audio wasn’t fully attached yet) with an off brand Nano, before it burnt out, (which is why I made changes).


This is my diagram. I am aware I did made a small error and forgot one of the GND pins on the nano to be connected to the GND wire but that has been fixed on the actual device. Also the Led Light Rings are daisy chained like the diagram, but they each also have their own power source.

try putting the QueueArray.h file in the project directory (along with your .ino file)
then include it using ""

#include "QueueArray.h"

Hi @cosplayinghelp

When we say "Arduino Nano" here on the forum, it is assumed that we are referring to the classic ATmega328P-based board of that name:

https://docs.arduino.cc/hardware/nano

But from this warning in the compilation output you shared:

I can see that you are compiling for an ESP32 board. This indicates one of two things:

  • You are using some hardware other than the classic Nano board (perhaps the Nano ESP32?).
  • You are truly using the classic Nano hardware, but have the wrong board selected from the Tools > Board menu in Arduino IDE.

So please tell us exactly which physical Arduino board you are using in your project.

This is the one I had purchased Nano ESP32

Did I order the wrong one?

I had managed to get the queue array in there now, thank you. This worked.

Since I am using an ESP board, I did also try to add in the ESP software serial library, however, ended up with the same error

You have another topic (maybe more than one) dealing with this project of yours.
Why did you buy a NanoESP32 ?

Yes. Cause before it was a hardware issue but now its a software issue

Why I bought it?
Honestly? Because I am an idiot who panic bought and didn’t read the description and thought it was the newest model cause I have 2 days to finish the project.

Happy Fingers result easy clicks.

Nano_ESP32 is different from "ESP32". You need to have the proper board cores installed: don't try programming a Nano_ESP32 with non-Nano ESP32 board selected - or the other way around.

They wanted the pin numbers of the Nano_ESP32 to align with, to be consistent with, the 'Classic' Nano pin numbers.

SoftwareSerial is not usable with ESP32 (of any variety). There are two (three?) hardware UARTs. I don't know what queuearray is - it may not be transferrable to ESP32's.

I don't want to get in the way of Tillisch's helping you.

the Nano ESP32 has hardware serial ports - no need for EspSoftSerial - see nano-esp32 pinout

Thank you for the explanation of the difference

I wouldn't necessarily say "wrong", but it is significantly different from the classic Nano board the creator of that portal gun project used. It is possible to use it in place of the classic Nano, but as you discovered it will require some adjustments (possibly to the circuitry in addition to the sketch). So the choice of the Nano ESP32 for this specific project does make it more challenging.

Please don't hold back on my account. The main purpose of my post was to follow up on an observation I made in order to obtain some information from @cosplayinghelp that I thought would be useful to the helpers providing assistance here.

I don't do a lot of work on supporting programming-related questions because I have more than I can keep up with in the tooling-related subjects I specialize in and there are quite a few more qualified forum members active in helping with programming.

Thank you for the clarification. I decided to rush order the actual Arduino Nano for this, and hopefully it will have no issues, since the code had worked with the knockoff, cheap Nanos I had used before they burnt out.

If I were to use it, how would I go around the code issue with the SoftwareSerial since it is not useable for the Nano ESP32 ? I have another project that I am making that if I can still use this board for, but just focusing on the audio section rather than having all the lights too. The audio part is what uses the SoftwareSerial in the code, so I am trying to figure out how this can be handled. What are the alternatives to SoftwareSerial?

Considering you are working under a deadline, I think you made the right decision. The Nano ESP32 is a very nice board so I'm sure you'll end up finding other projects to use it in.

I should warn you that, even with an official Nano, there is a good chance that if you subject it to the same conditions as the cheap Nano derivative boards, it is likely the same result of physical damage will occur.

Hopefully you already identified and resolved the problem in the project circuit, as I believe was discussed in your other topic: