Comments (5)
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.
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.
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.
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.
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)
- Examples in Arduino IDE 2.0 not opening correctly HOT 1
- Attach with Min Max bug HOT 2
- problems with midi library HOT 1
- Outdated `renesas` architecture ID used in library metadata HOT 2
- PWM duty cycle range not continuous on UNO R4 HOT 10
- Change Timer1 to Timer3 on ATmega32u4-based dev boards HOT 2
- Selectable timer prescaler
- add a `servo.stop()` function
- Release update that fixes servo jitter issue on R4 HOT 1
- Servo
- Add GitHub Actions workflow to synchronise with shared repository labels
- attach(pin) returns 0
- Raspberry Pico Compatibility; attach parameters
- Raspberry Pico Compatibility; servo read response HOT 1
- Make output frequency of the PWM signal adjustable. HOT 2
- Add support for 8-bit timers like Timer2 HOT 1
- Periodic glitches with Arduino nano and Savox SB-2290
- PWM signal sporadically inverted on Portenta H7 HOT 2
- add extend documentation to say which timers are used
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from servo.