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 · 5 comments

Comments

Projects
None yet
2 participants
@anthgur

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 from Servo.h not found to Servo.h not found - Arduino Nov 27, 2014

@ivankravets ivankravets added the bug label Nov 27, 2014

@ivankravets

This comment has been minimized.

Member

ivankravets commented Nov 27, 2014

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

This comment has been minimized.

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

This comment has been minimized.

Member

ivankravets commented Nov 28, 2014

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

@ivankravets

This comment has been minimized.

Member

ivankravets commented Dec 1, 2014

@anthgur

This comment has been minimized.

anthgur commented Dec 1, 2014

Works great, thanks!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment