help

Hi
I'm new
first of all I greet the whole community
or a big problem a friend of mine asked me for a favor
but before you tell them no
I wanted to know if you can help me
PS I have never used arduino so I'm screwed
or downloaded a code for arduino nano but mida of the errors how can i do
:sob: :sob: :sob: :sob:
this is the code
const int action_pin = 2;
int location = 31;
// Below numbers should be adjusted in case the facemask does not close/open to desired angle
int bottom_closed = 107;
int top_closed = 167;
int bottom_open = 20;
int top_open = 20;
void setup()
{
pinMode(action_pin, INPUT_PULLUP);
servoTop.attach(9);
servoBottom.attach(10);
setSpeedForAllServos(190);
servoTop.setEasingType(EASE_CUBIC_IN_OUT);
servoBottom.setEasingType(EASE_CUBIC_IN_OUT);
synchronizeAllServosStartAndWaitForAllServosToStop();
}
void loop()
{
int proximity = digitalRead(action_pin);
if (proximity == LOW)
{
if (location > bottom_open) {
servoTop.setEaseTo(top_open);
servoBottom.setEaseTo(bottom_open);
synchronizeAllServosStartAndWaitForAllServosToStop();
location = bottom_open;
delay(600);
} else {
servoTop.setEaseTo(top_closed);
servoBottom.setEaseTo(bottom_closed);
synchronizeAllServosStartAndWaitForAllServosToStop();
location = bottom_closed;
delay(600);
}
}
}

you tell me
Thanks in advance

you can also send me to that country for good reason

:cry: :cry: :disappointed_relieved: :disappointed_relieved: :disappointed_relieved:

Do you have a question?

Do you think this

Installation & Troubleshooting
For problems with Arduino itself, NOT your project

doesn't apply to you?

Follow the example:

#include <Servo.h> 

Servo myservo;

void setup() 
{ 
  myservo.attach(9);
}

could you perhaps provide a more useful title?

Also refer to these instructions

you can also send me to that country for good reason

this is what is called lost in translation.
'that country' kids might say H - E - double hockey sticks.

my other comment is that a battery powered face mask angle detector is interesting, but it would be in relation to the face and the mask. looking down at the floor, or up at the ceiling would be different.

It would be relational to the face.

Also, an end-switch might be just as workable. if the mask is not fully engaged, it would not close the switch.

In theory, it could work.
In practice, there are a lot of things to think about.

but the idea of a light or a beeper is possible and within the range of a microcontroller.

dave-in-nj:
this is what is called lost in translation.
'that country' kids might say H - E - double hockey sticks.

my other comment is that a battery powered face mask angle detector is interesting, but it would be in relation to the face and the mask. looking down at the floor, or up at the ceiling would be different.

It would be relational to the face.

Also, an end-switch might be just as workable. if the mask is not fully engaged, it would not close the switch.

In theory, it could work.
In practice, there are a lot of things to think about.

but the idea of a light or a beeper is possible and within the range of a microcontroller.

I think that was actually an excellent and most appropriate reply to the OP!