Giter Club home page Giter Club logo

Comments (5)

per1234 avatar per1234 commented on August 10, 2024 1

Hi @ghiathkamel. Thanks for submitting this issue.

I got these errors when compiling the code

It is important to understand the difference between warnings and errors. A warning is the compiler telling you there is something in the code that could possibly cause a problem but doesn't cause the compilation to fail. An error is a problem with the code that causes compilation to fail. In this case you have posted warnings, not errors. In order to avoid confusion, we should be careful to use the appropriate terminology when communicating about technical subjects.

The code in the library that causes the warnings should be fixed, and we will use this issue to track that task. However, as long as the library is functional you should not let the warnings distract you from progressing with your project.

from servo.

ghiathkamel avatar ghiathkamel commented on August 10, 2024

GPT4 told me:

To fix your warning, you need to replace the float parameter with a chrono duration in your code. > For example, instead of writing:

timeout.attach(mbed::callback(this, &ServoImpl::toggle), duration / 1e6);

You should write:

timeout.attach(mbed::callback(this, &ServoImpl::toggle), duration * 1us);

This will make your code more precise and compatible with future versions of Mbed OS.

But after editing Servo.cpp I got new errors.

from servo.

ghiathkamel avatar ghiathkamel commented on August 10, 2024

Hi @ghiathkamel. Thanks for submitting this issue.

It is important to understand the difference between warnings and errors. A warning is the compiler telling you there is something in the code that could possibly cause a problem but doesn't cause the compilation to fail. An error is a problem with the code that causes compilation to fail. In this case you have posted warnings, not errors. .

Hi per1234
Thank you very much for your reply, much appreciated
i got the warning in red color not white color so i thought it's error :)
good to know that i can go and try the code even with these warnings msgs.
please can you help me out , on Arduino H7 How can i set the servo output to 12-bit 333Hz? for 12bit output i used AnalogWriteResolution (12), and it look working but for setting the output at 333hz AnalogWriteFrequency (333) not working cuz i got errors when verifying the code, so what i need to use to get 333hz, the servo library standard output is 8bit with 50hz only, can i edit the servo.h file to get 333hz output ? but how?

please let me know!
Thanks

from servo.

per1234 avatar per1234 commented on August 10, 2024

please can you help me out , on Arduino H7 How can i set the servo output to 12-bit 333Hz?

This is not an appropriate place to request assistance with your project. You are welcome to ask over on Arduino Forum. I'm sure we'll be able to help you out over there:

https://forum.arduino.cc/c/using-arduino/programming-questions/20

from servo.

ghiathkamel avatar ghiathkamel commented on August 10, 2024

to get 333Hz output i changed the servo.h file to this REFRESH_INTERVAL 3000

#define MIN_PULSE_WIDTH       544     // the shortest pulse sent to a servo  
#define MAX_PULSE_WIDTH      2400     // the longest pulse sent to a servo 
#define DEFAULT_PULSE_WIDTH  1500     // default pulse width when servo is attached
#define REFRESH_INTERVAL    3000     // minimum time to refresh servos in microseconds 
#define SERVOS_PER_TIMER       12     // the maximum number of servos controlled by one timer 
#define MAX_SERVOS   (_Nbr_16timers  * SERVOS_PER_TIMER)
#define INVALID_SERVO         255     // flag indicating an invalid servo index

after changing this, there is no warning messages anymore, i did not change servo.cpp file, i dont know if i need to but it works :), what do you think?

from servo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.