Skip to content

Can't use standard STL includes in library code #86

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

Closed
grafalex82 opened this issue Nov 3, 2018 · 4 comments
Closed

Can't use standard STL includes in library code #86

grafalex82 opened this issue Nov 3, 2018 · 4 comments

Comments

@grafalex82
Copy link

grafalex82 commented Nov 3, 2018

When trying to compile DMStepper library arduino-cli hit #include (see https://github.com/toxnico/DMStepper/blob/master/src/dmsteppergroup.h) and tried to interpret this as an another library dependency

Alternatives for vector: []
ResolveLibrary(vector)
  -> candidates: []
In file included from /home/pi/Arduino/libraries/DMStepper/src/dmsteppergroup.cpp:1:0:
/home/pi/Arduino/libraries/DMStepper/src/dmsteppergroup.h:4:18: fatal error: vector: No such file or directory
 #include <vector>
                  ^
compilation terminated.

I have no idea why it did not find the include file - toolset has it at .packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/arm-none-eabi/include/c++/4.8.3

@GeraldR63
Copy link

Hello Grafalex,

to be able to compile dmstepper it's required to add line below to your sketch:

// ArduiniSTL required in front of dmstepper.h. Probably you have to install this
#include <ArduinoSTL.h>
#include <dmstepper.h>

Than you can compile and upload.

regards
Gerald

@grafalex82
Copy link
Author

Thanks. I'll try this

@GeraldR63
Copy link

Hello Grafalex82,

used this library today for my KUMAN DRV8255 driven steppers. It works very well.

I'm using "VariableTimedAction" for having the "Updates" scheduled every 5us..

class DMStepperSchedule : public VariableTimedAction
{
private:
unsigned long run ()
{
Capacitor.update();
return 0;
}
} DMStepperSchedule;

This is called every 5us.

Initialized in setup() 👍

void setup()
{
...
DMStepperSchedule.start(5);
irReader.start(5); // Also in setup, details below
}

Using one additional task for IR remote control.

class irReader : public VariableTimedAction
{
private:
unsigned long run ()
{
if (irrecv.decode(&results)) {
irrecv.resume(); // Receive the next value

switch (results.value)
{


  case 0xA32AB931: //Motor A
                   Serial.println("Backward");

                    Kondensator.run(1,100,100);

                   break;

  case 0x143226DB: //Motor A
                   Serial.println("Forward");
                    Kondensator.run(-1,100,100);
                   break;                       

}
}
}
} irReader;

This works not "very fast" but the Capacitor rotates.
Using DMStepper is more or less Okay cause it reduces complexity of code a little bit.

regards
Gerald

@facchinm
Copy link
Member

facchinm commented Jan 2, 2019

Closing as fixed

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

No branches or pull requests

3 participants