Asked — Edited

Servospeed

i see the servo speed is diff as usuall ?

its for the init start for roli.

is it servo(d12,$speed) or servo(d12,4)

Skip to comments

ARC Pro

Upgrade to ARC Pro

Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!

PRO
Synthiam
#1  

You can load the roli project and view the init script. Here is the init script as of today (2016/04/14):

Code:

This is the initialization script for your Roli robot

This script is called from the Connection Control when a connection

is made to the Roli EZ-B

Set the max and min positions of some servos so

they cannot move past their limitations

Left Gripper

SetServoMin(d16, 30) SetServoMax(d16, 90)

Right Gripper

SetServoMin(d12, 30) SetServoMax(d12, 90)

Move the servos into the calibration position

All servos will be set to 90 degrees

ControlCommand("Auto Position", AutoPositionFrameJump, "Calibrate")

Pause for a brief period of time to ensure the servos have been initialized

sleep(500)

We want the arm and neck servos to move smoothly

To do this, we will set the speed of each servo

The speed is how quickly a servo will move between positions

We set a variable for the speed, and then use that variable for

every speed command.

This is an effecient way to reuse a value numerous times

$speed = 1

servospeed(d12, $speed) servospeed(d13, $speed) servospeed(d14, $speed) servospeed(d15, $speed) servospeed(d16, $speed) servospeed(d17, $speed) servospeed(d18, $speed) servospeed(d19, $speed)

This sets the speed for the HBridge Motor Controller

The speed is a number between 0 and 255

Setting this speed will initialize the PWM on the motor controller

SetSpeed(255)

Even though we set the speed, we will also enable the PWM

on the speed pins that connect to the HBridge Motor Controller

The number is 100, which means 100%

pwm(d0, 100) pwm(d5, 100)

This sets up variables for use within the mobile interface

as a toggle for using the sliders for movement and to keep

of the direction currently moving

$DirectionMobile=""

PRO
Belgium
#2  

yes i now that.i want to let go the servo slower a start up. so do i need to set the speed to 4 instead or $speed ?

i want the arms and head/neck go slower

PRO
Belgium
#3  

think i have it

servospeed(D12,$speed=4)

PRO
Synthiam
#4  

$speed is a variable, it holds values. Change the value that is assigned to $speed

Code:

$speed = 4

The description of $speed is right there in the code. The code has a big chunk that explains $speed is a variable. Read the descriptions in the code, it will help make sense.

PRO
Belgium
#5  

okay dj thanks

1 is fast and 4 is slower