Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hanging Code #1

Open
2 tasks
mrfrase3 opened this issue Sep 23, 2020 · 0 comments
Open
2 tasks

Hanging Code #1

mrfrase3 opened this issue Sep 23, 2020 · 0 comments

Comments

@mrfrase3
Copy link
Collaborator

Someone submitted the following code to be compiled, something about it caused the compiler to hang and not return anything.

Whilst it was taking 1 min to timeout, the user became impatient and spammed the compile button, causing the compile server to become overloaded.

Need to:

  • find the cause of the issue in this code
  • impose rate limiting on compiling
char val;
#include<Servo.h>
Servo myServo
/'myServo
const int controlPin1 = 2;
const int controlPin2 = 3; 
const int enablePin = 9;

void setup() {
  myServo.attatch(4);
  pinMode(controlPin1, OUTPUT);
  pinMode(controlPin2, OUTPUT);
  pinMode(enablePin, OUTPUT);
}
   
if (val=='a'){
  myServo.Write(90);
  delay(40);
}

else if (val=='d'){
  myServo.Write(180);
  delay(30);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant