# Trying to upload code to nano

**URL:** <https://forum.arduino.cc/t/trying-to-upload-code-to-nano/1312842>\
**Category:** Programming\
**Created:** [October 19, 2024, 12:06am UTC](https://forum.arduino.cc/t/trying-to-upload-code-to-nano/1312842 "2024-10-19T00:06:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dannyc9923](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dannyc9923/32/1113466_2.png) [@dannyc9923](https://forum.arduino.cc/u/dannyc9923)\
**Post date:** [October 19, 2024, 12:06am UTC](https://forum.arduino.cc/t/trying-to-upload-code-to-nano/1312842/1 "2024-10-19T00:06:42Z")

</div>

I am trying to upload a fairly simple code.  
I have installed the servoeasing lib  
here is the code

```arduino
#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

```arduino
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

```

---

<div class="post-metadata">

**Author:** ![van\_der\_decken](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/van_der_decken/32/1006976_2.png) [@van\_der\_decken](https://forum.arduino.cc/u/van_der_decken)\
**Post date:** [October 19, 2024, 12:15am UTC](https://forum.arduino.cc/t/trying-to-upload-code-to-nano/1312842/2 "2024-10-19T00:15:24Z")

</div>

Did you not notice the warning above the errors?

```arduino
 #warning You probably must change the line #include "ServoEasing.h" to #include "ServoEasing.hpp" in your ino file or define SUPPRESS_HPP_WARNING before the include to suppress this warning.

```

Including `ServoEasing.hpp` instead of `ServoEasing.h` got your sketch to compile for me.

---

<div class="post-metadata">

**Author:** ![dannyc9923](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dannyc9923/32/1113466_2.png) [@dannyc9923](https://forum.arduino.cc/u/dannyc9923)\
**Post date:** [October 19, 2024, 12:16am UTC](https://forum.arduino.cc/t/trying-to-upload-code-to-nano/1312842/3 "2024-10-19T00:16:10Z")

</div>

Nope geez thanks man

---

<div class="post-metadata">

**Author:** ![dannyc9923](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dannyc9923/32/1113466_2.png) [@dannyc9923](https://forum.arduino.cc/u/dannyc9923)\
**Post date:** [October 19, 2024, 12:19am UTC](https://forum.arduino.cc/t/trying-to-upload-code-to-nano/1312842/4 "2024-10-19T00:19:01Z")

</div>

WHere do you see that

---

<div class="post-metadata">

**Author:** ![van\_der\_decken](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/van_der_decken/32/1006976_2.png) [@van\_der\_decken](https://forum.arduino.cc/u/van_der_decken)\
**Post date:** [October 19, 2024, 12:35am UTC](https://forum.arduino.cc/t/trying-to-upload-code-to-nano/1312842/5 "2024-10-19T00:35:55Z")

</div>

Complete compile output follows:

```arduino
arduino-cli compile -b arduino:avr:nano:cpu=atmega328 --warnings all --output-dir ~/tmp --no-color (in directory: /home/me/Documents/sketchbook/Nano/test)

In file included from /home/me/Documents/sketchbook/Nano/test/test.ino:1:0:
/home/me/Documents/sketchbook/libraries/ServoEasing/src/ServoEasing.h:930:2: warning: #warning You probably must change the line #include "ServoEasing.h" to #include "ServoEasing.hpp" in your ino file or define SUPPRESS_HPP_WARNING before the include to suppress this warning. [-Wcpp]
 #warning You probably must change the line #include "ServoEasing.h" to #include "ServoEasing.hpp" in your ino file or define SUPPRESS_HPP_WARNING before the include to suppress this warning.
  ^ ~~~~~~
/tmp/ccTK3itH.ltrans0.ltrans.o: In function `setup':
/home/me/Documents/sketchbook/Nano/test/test.ino:14: undefined reference to `ServoEasing::attach(int)'
/home/me/Documents/sketchbook/Nano/test/test.ino:15: undefined reference to `ServoEasing::attach(int)'
/home/me/Documents/sketchbook/Nano/test/test.ino:16: undefined reference to `setSpeedForAllServos(unsigned int)'
/home/me/Documents/sketchbook/Nano/test/test.ino:17: undefined reference to `ServoEasing::setEasingType(unsigned char)'
/home/me/Documents/sketchbook/Nano/test/test.ino:18: undefined reference to `ServoEasing::setEasingType(unsigned char)'
/home/me/Documents/sketchbook/Nano/test/test.ino:19: undefined reference to `synchronizeAllServosStartAndWaitForAllServosToStop()'
/tmp/ccTK3itH.ltrans0.ltrans.o: In function `loop':
/home/me/Documents/sketchbook/Nano/test/test.ino:27: undefined reference to `ServoEasing::setEaseTo(int)'
/home/me/Documents/sketchbook/Nano/test/test.ino:28: undefined reference to `ServoEasing::setEaseTo(int)'
/home/me/Documents/sketchbook/Nano/test/test.ino:29: undefined reference to `synchronizeAllServosStartAndWaitForAllServosToStop()'
/home/me/Documents/sketchbook/Nano/test/test.ino:33: undefined reference to `ServoEasing::setEaseTo(int)'
/home/me/Documents/sketchbook/Nano/test/test.ino:34: undefined reference to `ServoEasing::setEaseTo(int)'
/home/me/Documents/sketchbook/Nano/test/test.ino:35: undefined reference to `synchronizeAllServosStartAndWaitForAllServosToStop()'
/tmp/ccTK3itH.ltrans0.ltrans.o: In function `_GLOBAL__sub_I_servoTop':
/home/me/Documents/sketchbook/Nano/test/test.ino:2: undefined reference to `ServoEasing::ServoEasing()'
/home/me/Documents/sketchbook/Nano/test/test.ino:3: undefined reference to `ServoEasing::ServoEasing()'
collect2: error: ld returned 1 exit status
Used library Version Path
ServoEasing 3.3.0 /home/me/Documents/sketchbook/libraries/ServoEasing
Servo 1.2.1 /home/me/Documents/sketchbook/libraries/Servo
Used platform Version Path
arduino:avr 1.8.3 /home/me/.arduino15/packages/arduino/hardware/avr/1.8.3
Error during build: exit status 1
Compilation failed.

```

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [April 17, 2025, 12:36am UTC](https://forum.arduino.cc/t/trying-to-upload-code-to-nano/1312842/6 "2025-04-17T00:36:51Z")

</div>

Closed on April 17, 2025, 12:36am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
