I am trying to upload a fairly simple code.
I have installed the servoeasing lib
here is the code
#include "ServoEasing.h"
ServoEasing servoTop;
ServoEasing servoBottom;
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);
}
}
}
HERE ARE THE ERRORS
C:\Users\ALIENW~1\AppData\Local\Temp\ccmocYCk.ltrans0.ltrans.o: In function `setup':
C:\Users\Alienware\AppData\Local\Temp\.arduinoIDE-unsaved2024918-11712-tmmkxf.i79jf\sketch_oct18a/sketch_oct18a.ino:14: undefined reference to `ServoEasing::attach(int)'
C:\Users\Alienware\AppData\Local\Temp\.arduinoIDE-unsaved2024918-11712-tmmkxf.i79jf\sketch_oct18a/sketch_oct18a.ino:15: undefined reference to `ServoEasing::attach(int)'
C:\Users\Alienware\AppData\Local\Temp\.arduinoIDE-unsaved2024918-11712-tmmkxf.i79jf\sketch_oct18a/sketch_oct18a.ino:16: undefined reference to `setSpeedForAllServos(unsigned int)'
C:\Users\Alienware\AppData\Local\Temp\.arduinoIDE-unsaved2024918-11712-tmmkxf.i79jf\sketch_oct18a/sketch_oct18a.ino:17: undefined reference to `ServoEasing::setEasingType(unsigned char)'
C:\Users\Alienware\AppData\Local\Temp\.arduinoIDE-unsaved2024918-11712-tmmkxf.i79jf\sketch_oct18a/sketch_oct18a.ino:18: undefined reference to `ServoEasing::setEasingType(unsigned char)'
C:\Users\Alienware\AppData\Local\Temp\.arduinoIDE-unsaved2024918-11712-tmmkxf.i79jf\sketch_oct18a/sketch_oct18a.ino:19: undefined reference to `synchronizeAllServosStartAndWaitForAllServosToStop()'
C:\Users\ALIENW~1\AppData\Local\Temp\ccmocYCk.ltrans0.ltrans.o: In function `loop':
C:\Users\Alienware\AppData\Local\Temp\.arduinoIDE-unsaved2024918-11712-tmmkxf.i79jf\sketch_oct18a/sketch_oct18a.ino:27: undefined reference to `ServoEasing::setEaseTo(int)'
C:\Users\Alienware\AppData\Local\Temp\.arduinoIDE-unsaved2024918-11712-tmmkxf.i79jf\sketch_oct18a/sketch_oct18a.ino:28: undefined reference to `ServoEasing::setEaseTo(int)'
C:\Users\Alienware\AppData\Local\Temp\.arduinoIDE-unsaved2024918-11712-tmmkxf.i79jf\sketch_oct18a/sketch_oct18a.ino:29: undefined reference to `synchronizeAllServosStartAndWaitForAllServosToStop()'
C:\Users\Alienware\AppData\Local\Temp\.arduinoIDE-unsaved2024918-11712-tmmkxf.i79jf\sketch_oct18a/sketch_oct18a.ino:33: undefined reference to `ServoEasing::setEaseTo(int)'
C:\Users\Alienware\AppData\Local\Temp\.arduinoIDE-unsaved2024918-11712-tmmkxf.i79jf\sketch_oct18a/sketch_oct18a.ino:34: undefined reference to `ServoEasing::setEaseTo(int)'
C:\Users\Alienware\AppData\Local\Temp\.arduinoIDE-unsaved2024918-11712-tmmkxf.i79jf\sketch_oct18a/sketch_oct18a.ino:35: undefined reference to `synchronizeAllServosStartAndWaitForAllServosToStop()'
C:\Users\ALIENW~1\AppData\Local\Temp\ccmocYCk.ltrans0.ltrans.o: In function `_GLOBAL__sub_I_servoTop':
C:\Users\Alienware\AppData\Local\Temp\.arduinoIDE-unsaved2024918-11712-tmmkxf.i79jf\sketch_oct18a/sketch_oct18a.ino:2: undefined reference to `ServoEasing::ServoEasing()'
C:\Users\Alienware\AppData\Local\Temp\.arduinoIDE-unsaved2024918-11712-tmmkxf.i79jf\sketch_oct18a/sketch_oct18a.ino:3: undefined reference to `ServoEasing::ServoEasing()'
collect2.exe: error: ld returned 1 exit status
exit status 1
Compilation error: exit status 1