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

Servo.h not found - Arduino #28

Closed
anthgur opened this issue Nov 27, 2014 · 7 comments
Closed

Servo.h not found - Arduino #28

anthgur opened this issue Nov 27, 2014 · 7 comments
Assignees
Labels

Comments

@anthgur
Copy link

anthgur commented Nov 27, 2014

I can't seem to find the Arduino Servo library in the registry. I'm not sure if this is related to #23. How should I go about including the Arduino core libraries?

Thanks

@anthgur anthgur changed the title Servo.h not found Servo.h not found - Arduino Nov 27, 2014
@ivankravets
Copy link
Member

Ooops... Sorry... 😢 I've not seen it earlier. Arduino changed a structure for "built-in" libraries in 1.5.x branch. Now, the source code of the library is located in src directory and is split to "architectures" directories within src directory.

I will fix it as soon as possible. You can try this solution to fix it now:

  1. Copy from https://github.com/arduino/Arduino/tree/ide-1.5.x/libraries/Servo/src all content to %_your_platformio_based_project_dir%/lib/Servo. It should look like:
lib/Servo/Servo.h
lib/Servo/avr/...
lib/Servo/sam/...
  1. Add additional flag to your build environment in "platformio.ini":
[env:mybaseenv]
platform = atmelavr
framework = arduino
board = %YOU_BOARD_HERE%
build_flags = "-DARDUINO_ARCH_AVR"
  1. Use in your source code *.ino/c/h/cpp like:
#include <Servo.h>
...

@anthgur
Copy link
Author

anthgur commented Nov 27, 2014

I tried something similar that worked but I didn't have the build_flags field in my env, is that a problem for me? Thank you!

@ivankravets ivankravets added this to the 1.0.0 milestone Nov 28, 2014
@ivankravets ivankravets self-assigned this Nov 28, 2014
@ivankravets
Copy link
Member

If you don't see "red compile errors", then you can use it without -DARDUINO_ARCH_AVR build flag

@ivankravets
Copy link
Member

Please run platformio upgrade
https://twitter.com/platformiotool/status/539533696404299776

@anthgur
Copy link
Author

anthgur commented Dec 1, 2014

Works great, thanks!

@ivankravets ivankravets removed this from the 1.0.0 milestone Feb 11, 2015
@civet
Copy link

civet commented Dec 12, 2019

@ivankravets
platformio version 4.1.0
Servo.h not found (for arduino) again.

@etulupov
Copy link

@civet You should add Servo library in platformio.ini

lib_deps =
     arduino-libraries/Servo @ 1.1.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants