DMV style queue

I can’t figure out what is wrong with my code and it’s also creating errors in my arduino.
Serial monitor loops numbers 1, 2, 3, 4 then i get the message “QUEUE: insufficient memory to create a new node.”

here is my code.

//Libraries used:
//QueueList
//Sindormir Seven segment
#include <SindormirSevenSegments.h>
#include <QueueList.h>

int desk1 = 8;
int desk2 = 9;
int desk3 = 11;
int desk4 = 12;
int Teacher = 10;

const int desk1no = 1;
const int desk2no = 2;
const int desk3no = 3;
const int desk4no = 4;


SindormirSevenSegments my7S(0,1,2,3,4,5,6,7);

QueueList <int> queue; //TRY WITH STRING IF DOESNT WORK

void setup() {
 pinMode(desk1,INPUT);
pinMode(desk2,INPUT);
pinMode(desk3,INPUT);
pinMode(desk4,INPUT);
pinMode(Teacher,INPUT);
Serial.begin(9600);
queue.setPrinter (Serial);


}

void loop() {
 delay(1000);

if (desk1=HIGH)
{
queue.push (desk1no); 
}

if (desk2=HIGH)
{
queue.push (desk2no);  
}

if (desk3=HIGH)
{
queue.push (desk3no);  
}

if (desk4=HIGH)
{
queue.push (desk4no);  
}

if (Teacher=HIGH)
{
//queue.pop(); // may require Serial.println
Serial.println (queue.pop ());
}

 if (Serial.available() > 0) {
   int inByte = Serial.read();
switch (inByte) {
case '1':
    my7S.print(1);
       break;
     case '2':
     my7S.print(2);
       break;
     case '3':
     my7S.print(3);
       break;
     case '4':
     my7S.print(4);
       break;
     default:
     my7S.print(0);
}}
// else {
//  my7S.print(0);

//}
}
if (desk1=HIGH)

Oops.

Please use code tags when posting code.

I noticed that error and updated my code. It’s still not working right

//Libraries used:
//QueueList
//Sindormir Seven segment
#include <SindormirSevenSegments.h>
#include <QueueList.h>

const int desk1pin = 8;
const int desk2pin = 9;
const int desk3pin = 11;
const int desk4pin = 12;
const int teacherpin = 10;

int Desk1;
int Desk2;
int Desk3;
int Desk4;
int Teacher;

const int desk1no = 1;
const int desk2no = 2;
const int desk3no = 3;
const int desk4no = 4;


 SindormirSevenSegments my7S(0,1,2,3,4,5,6,7);

QueueList <int> queue; //TRY WITH STRING IF DOESNT WORK

void setup() {
  pinMode(desk1pin,INPUT);
pinMode(desk2pin,INPUT);
pinMode(desk3pin,INPUT);
pinMode(desk4pin,INPUT);
pinMode(teacherpin,INPUT);

pinMode(0,OUTPUT);
pinMode(1,OUTPUT);
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);

 Serial.begin(9600);
 queue.setPrinter (Serial);


}

void loop() {
  Desk1 =digitalRead(desk1pin);
  Desk2=digitalRead(desk2pin);
  Desk3=digitalRead(desk3pin);
  Desk4=digitalRead(desk4pin);
  Teacher=digitalRead(teacherpin);
//  delay(1000);

if (Desk1==HIGH)
{
queue.push (desk1no); 
}

if (Desk2==HIGH)
{
queue.push (desk2no);  
}

if (Desk3==HIGH)
{
queue.push (desk3no);  
}

if (Desk4==HIGH)
{
queue.push (desk4no);  
}

if (Teacher==HIGH)
{
//queue.pop(); // may require Serial.println
 Serial.println (queue.pop ());
}

  if (Serial.available() > 0) {
    int inByte = Serial.read();
switch (inByte) {
case '1':
     my7S.print(1);
        break;
      case '2':
      my7S.print(2);
        break;
      case '3':
      my7S.print(3);
        break;
      case '4':
      my7S.print(4);
        break;
      default:
      my7S.print(0);
}}
// else {
 //  my7S.print(0);

//}
}

How many times do you think Desk1 (for example) is HIGH?

How about only pushing something when it becomes HIGH?

That is what i want to do.
The plan is that it's going to display the number of the desk that has pressed the pushbutton. When the 'Teacher" pushbutton is pressed it flips the 7 segment to the number that is next in the queue. I'm just not sure where to go from here.

Also, i'm finding that i have to take the circuit apart and switch boards in order to upload new code. I get timeout errors.

Shouldn't you be checking whether the inputs have become pressed rather than if they are pressed ? Otherwise each time through loop() another entry will be placed in the queue.

i'm finding that i have to take the circuit apart and switch boards in order to upload new code.

SindormirSevenSegments my7S(0,1,2,3,4,5,6,7);Are you using the serial pins (0 and 1) for the display ? If so then this may be interfering with the code upload.

I just switched the 0 and 1 pins and it solved the uploading problem.

How do i make it so it reads when it becomes pressed? I'm new to this.

How do i make it so it reads when it becomes pressed?

If it wasn't pressed last time you looked at it, and it is pressed now, it has become pressed.

AWOL:
If it wasn't pressed last time you looked at it, and it is pressed now, it has become pressed.

The state change detection example illustrates this.