EZ-Builder Release 2012.06.02.00

Download and install the latest EZ-Builder robot programming software to experience these updates.

Download EZ-Builder
This is a very small update.

EZ-Builder Changes
- Motion Tracking has "skip frame" option to avoid robot from going crazy
- Camera Snapshot control re-added

EZ-SDK Changes
- Multiple camera support
- Capture resolution
- eZ430
- Augmented Reality Image Overlay
- Wii Remote enhancements
Synthiam
#2  
In the last few latest version of the SDK, you must call Process "UpdatePreview"

Before, the preview window was auto updated with every object detection command - that used way too much processing since you only want to update the window occasionally.

So Camera.UpdatePreview() needs to be executed for you

Here is an example..

Code:


private void timer1_Tick(object sender, EventArgs e) {

if (!_camera.IsActive)
return;

ColorDetection.ColorEnum color = (ColorDetection.ColorEnum)comboBox3.SelectedItem;
ObjectLocation objectLocation = _camera.CameraBasicColorDetection.GetObjectLocationByColor(color, 10, (byte)trackBar1.Value);

_camera.UpdatePreview();

if (!objectLocation.isFound)
return;

if (_ezb.IsConnected) {

int position = _ezb.Servo.GetServoPosition(Servo.ServoPortEnum.D12);

if (objectLocation.horizontalLocation == ObjectLocation.HorizontalLocationEnum.Left)
position++;
else if (objectLocation.horizontalLocation == ObjectLocation.HorizontalLocationEnum.Right)
position--;

_ezb.Servo.SetServoPosition(Servo.ServoPortEnum.D12, position);
}

string logMsg = string.Format("Object found at {0} {1}", objectLocation.horizontalLocation, objectLocation.verticalLocation);

tbLog.AppendText(logMsg);
tbLog.AppendText(Environment.NewLine);
}
Ecuador
#3  
mmm! interesting... I will try this night.... thanks! ez rocks!
Ecuador
#4  
Hi Dj again...

I have been creating my own program but I have a question.. In SDK the servos positions are between 1 to 100? or 1 to 140??? Thanks
#5  
1-100 you can use EZ_B.Servo.SERVO_MAX and EZ_B.Servo.SERVO_MIN for defining, incase DJ increases the amount of positions or changes in future firmware updates.
Ecuador
#6  
oooh! @orwnic82 Thanks!:)
Synthiam
#7  
That's right Orwnic:) All of the max and min positions are specified for things like PWM and servo and ServoSpeed, etc:)

That way you can reference them for what Orwnic said - if they ever change in the future