Se agregó un botón extra que se llama limpia para borrar después de grabar la posición inicial como final en las etiquetas, después serán las de los servos

Ademas fueron usadas dos variables globales

En la imagen se verá un pantallazo del como quedó el programa!!

Aún le falta un boton más para que envié los datos "almacenados" al microcontrolador

Se me olvidaba, si modifico el valor del spinner no se mueve aún el slider correspondiente eso ya lo haré al ratin


Así como configurar el puerto serial entre otras cosas!!, espero sus comentarios para ir mejorando este pequeño proyecto, gracias! por los comentarios de los listeros






aqui les presento el código que se implemento!
- Código:
' Gambas class file
PUBLIC flag AS Boolean = FALSE ' variable global para meter datos en los labels
PUBLIC flag2 AS Boolean = FALSE
PUBLIC SUB _new()
END
PUBLIC SUB Form_Open()
DIM flag AS Boolean = FALSE
END
PUBLIC SUB Button2_Click()
ME.Close
END
PUBLIC SUB sldServo1_Change()
spnServo1.Value = sldServo1.Value
END
PUBLIC SUB btnSalir_Click()
ME.Close()
END
PUBLIC SUB btnGraba_Click() ' graba las posiciones de los servos
IF flag = FALSE AND flag2 = FALSE THEN
lblS1a.Text = lblS1a.text & " " & spnServo1.Value
lblS2a.Text = lblS2a.text & " " & spnServo2.Value
lblS3a.Text = lblS3a.Text & " " & spnServo3.Value
lblS4a.Text = lblS4a.Text & " " & spnServo4.Value
lblS5a.Text = lblS5a.Text & " " & spnServo5.Value
flag = TRUE
ELSE IF flag = TRUE AND flag2 = FALSE
lblS1b.Text = lblS1b.Text & " " & spnServo1.Value
lblS2b.Text = lblS2b.Text & " " & spnServo2.Value
lblS3b.Text = lblS3b.Text & " " & spnServo3.Value
lblS4b.Text = lblS4b.Text & " " & spnServo4.Value
lblS5b.Text = lblS5b.Text & " " & spnServo5.Value
flag2 = TRUE
ELSE
Message.Warning("No puedes grabar mas de dos posiciones pulsa LIMPIAR")
END IF
END
PUBLIC SUB sldServo2_Change()
spnServo2.Value = sldServo2.Value
END
PUBLIC SUB sldServo3_Change()
spnServo3.Value = sldServo3.Value
END
PUBLIC SUB sldServo4_Change()
spnServo4.Value = sldServo4.Value
END
PUBLIC SUB sldServo5_Change()
spnServo5.Value = sldServo5.Value
END
PUBLIC SUB btnLimpia_Click() 'este boton pone en falso la flag para iniciar una nueva grabacion de posiciones
flag = FALSE
flag2 = FALSE
lblS1a.Text = "Pos="
lblS1b.Text = "Pos="
lblS2a.Text = "Pos="
lblS2b.Text = "Pos="
lblS3a.Text = "Pos="
lblS3b.Text = "Pos="
lblS4a.Text = "Pos="
lblS4b.Text = "Pos="
lblS5a.Text = "Pos="
lblS5b.Text = "Pos="
END