Controlling servo
Re: Controlling servo
ok thank you for the feedback. will keep an eye on the updates
-
- Posts: 6
- Joined: 01 Oct 2016 17:15
Re: Controlling servo
Hello, I'd also like to control a servo.
I have previously done it via servo.h library on my normal Arduino.
I was using the following code, which is much simpler than what the original poster wants.
However, the library seems not supported. Anyway i can already achieve the below?
(Basically i want the Z-Uno to make a sweep with the Servo, 180° and back when its turned on, and then turn back off to sleep mode)
I have previously done it via servo.h library on my normal Arduino.
I was using the following code, which is much simpler than what the original poster wants.
However, the library seems not supported. Anyway i can already achieve the below?
(Basically i want the Z-Uno to make a sweep with the Servo, 180° and back when its turned on, and then turn back off to sleep mode)
Code: Select all
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup()
{
myservo.attach(10); // attaches the servo on pin 10 to the servo object
for(pos = 0; pos <= 0; pos += 7) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
{delay(2000);}
for(pos = 180; pos>=160; pos-=7) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
void loop()
{}
Re: Controlling servo
We have not yet finished timers support in Z-Uno. They are required for servo. Hope we do it by November.
-
- Posts: 6
- Joined: 01 Oct 2016 17:15
Re: Controlling servo
Any update on this? Can i finally start converting my project to ZWave?
Re: Controlling servo
Interrupts are our next release. First will be INT1 and INT0 and then GPT + Zerox. GPT is what you want!
Re: Controlling servo
Any updates to control the servo now?
Re: Controlling servo
First interrupts will be released for tests soon. 2.0.8 is on the way. Many-many small fixes!
Re: Controlling servo
Test version with Timers is available. Check viewtopic.php?f=3427&t=24573
Soon we will make an example with servo
Soon we will make an example with servo
Re: Controlling servo
The simple library for servos now is available in 2.0.9. Try it. https://forum.z-wave.me/viewtopic.php?f=3427&t=24680
Re: Controlling servo
What is the current status of this Zuno Servo library?
I have tried the example sketch but the servo jitters a lot even when the value isn't changing. I can work around this by switching the servo controller off with servo.end() after it reaches its position. In my application (controlling blinds) this works fine, but in other situations turning off the servo means it will not hold its position is a force is applied to the arm.
I have tried the example sketch but the servo jitters a lot even when the value isn't changing. I can work around this by switching the servo controller off with servo.end() after it reaches its position. In my application (controlling blinds) this works fine, but in other situations turning off the servo means it will not hold its position is a force is applied to the arm.