Microsoft Visual Basic 2010 Express + Motor

Hello,

I use Visual Basic 2010 to control my Lego Robot. It works.

How can i change PWM speed Motor while Button click? Slow = 50 ; Fast = 255

Arduino Code Arduino_Motor_Shield__L293___SKU__DRI0001_-DFRobot

case 'w'://Move ahead
                        Motor1(255,true);  //You can change the speed, such as Motor(50,true)
                        Motor2(255,true);
                         break;

Visual Basic 2010 Code

Private Sub slowButton_Click(sender As System.Object, e As System.EventArgs) Handles slowButton.Click
        SerialPort1.Write("1")
        slowButton.BackColor = Color.Yellow
        fastButton.BackColor = Color.Transparent
    End Sub

    Private Sub fastButton_Click(sender As System.Object, e As System.EventArgs) Handles fastButton.Click
        SerialPort1.Write("2")
        slowButton.BackColor = Color.Transparent
        fastButton.BackColor = Color.Yellow
    End Sub

Bye DEAF BOY