Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.
Get Started

Asked

WISH LIST - Auto Connect Check Box And Servo Buttons

Hi guys,

I can't find a wish list area, so I'm posting this here. If there is a wish list area, please move this post there.

I would like to see an Auto Connect checkbox in the connections setup. and a Min and Max buttons and slide bar added to servo Controls, is this possible?

User-inserted image


Thanks for listening
Steve


Related Hardware LattePanda
Related Control Horizontal Servo
AI Support Bot
Related Content
Synthiam
#4   — Edited
@Dave Schulpius Hi mate, Thanks for your reply.
I'm as newb as it gets, and you should never apologize for dummying down an answer or question, there is always someone who will learn from basics, but fewer that will learn from to techy answers.

I'm using is a :
LattePanda with Leonardo on comm5 - (EZ-Genuino_Leonardo-636967356658216814.zip)
Arduino mega on com7 - (EZ-Mega-v1-636848729355769322.zip)
ARC - (2020-03-19 - so I could create a shortcut)

The reason for an Auto Connect box next to each board connection is because it can't get any simpler than checking a box to automatically connect on startup, and it would be in your face, so it would stop anyone else wondering how to autoconnect once a project opens.

I have created a script I called "STARTUP" on the ARC desktop to connect each board and set servos

ControlCommand( "Connection", Connect0) #To connect LattePanda Leonardo
Sleep(200)
ControlCommand( "Connection", Connect1) #To connect Arduino Mega
Sleep(500)

Servo(1,D4, 0)
Servo(1.D5, 0)
ServoSpeed(1.D4, 0)
ServoSpeed(1.D5, 10)
Servo(1,D4, 90)
Servo(1.D5, 90)

Clicking start in the control connects each board and moves the servos to 90 degrees, but speed doesn't seem to do anything, not sure why, all my searches indicate I have used the correct command "ServoSpeed", as you have also instructed, or does it only work on IoTiny and EZ-Bv4 ?

The servo buttons (I have created script collections, which work great) but to make it easier to move a servo from the servo control, I find the mouse click drag hard to use, maybe partly because I'm using a keyboard with touch pad. and the drop down percentage box (because I have min =1 and max 180) it involves scrolling each time I want to set the min or max position. buttons and slider would make it so much easier and quicker. ( I want to look into how to create controls eventually, but atm
I have to many basics to learn, Controlling Camera, mic, Motors, Neopixels etc)

I have created a shortcut, (Which autostarts my "AZ.EZB" (Yer I know its a really creative name lol) it Starts ARC, Opens Project, Connects the 2 connections and moves servos, but speed still doesn't seen to work.

Any other basic tips would be great ;-)))

Cheers mate
Steve
#5   — Edited
ServoSpeed (servoPort, speed)
Set the speed of servo or PWM. This is the speed to move between positions.
The servo speed is a number between 0 (fastest) and 10 (slowest)
*Note: To initialize the ServoSpeed() at first use, set a Servo() position before using the ServoSpeed() command. If there is no previous position (such as during power-on), the software assumes the position is 0 and will cause issues with your robot.
*Note: Once the ServoSpeed() has been initialized the first time, specify the ServoSpeed() before specifying the Servo() position.
Example: ServoSpeed(D14, 25)

I assume you have more then one controller because you have a 1 at the start of each command? 
Also in this command "Servo(1,D4, 90)" you have a comma behind the 1 instead of a period. It should like this: Servo(1.D4, 90) 

Try this in your first start up script. You may or may not need the Sleep commands. If you do need the sleep commands you may have to make them longer so the next command has time to process:

Code:

Servo(1.D4, 90)
Sleep(100)
ServoSpeed(1.D4, 0)
Sleep(100)
Servo(1.D5, 90)
Sleep(100)
ServoSpeed(1.D5, 10)
#6  
Hi Dave

I do actually have commas, I guess I fat fingered when typing in comment.

I updated start script with Sleep(500) and still not working.

I think Ive found the problem thou, I tried ServoSpeed on my EZ-Bv4 and it works fine, but on the LattePanda (built in Leonardo and the Mega on the 2nd com port) ServoSpeed doesnt seem to work, does this sound possible?

Software/Drivers used:
LattePanda with Leonardo - (EZ-Genuino_Leonardo-636967356658216814.zip)
Arduino mega on 2nd com port - (EZ-Mega-v1-636848729355769322.zip)
ARC - (2020-03-19)

Thanks
Steve
Synthiam
#7  
I believe the only controller that supports a servospeed on Pwm servos is the ezrobot ezb b4 and ezrobot iotiny. Dynamixel servos do support that feature independent of the controller, however.
#8   — Edited
Hi DJ

Bummer:(
Is there a way of slowing down a servo in Java on a Leonardo and mega?

Will moving 1 degree at a time going to cause a problem?
Synthiam
#9   — Edited
You can use the Servo.increment() in JavaScript in a loop with a short sleep() after each command:)

im on my phone so I’ll try to type and example for you ...

Code:


function moveSlow(var servo, var position) {

var start = Servo.getPosition(servo);

if (position < start) {

for (var x = position; x > start; x) {
  
  Servo.decrement(servo, 1);
  sleep(250);
}

} else {

for (var x = position; x > start; x++) {

Servo.increment(servo, 1);
sleep(250);
}

}

}


moveSlow(d0, 130);
moveSlow(d0, 30);