Go Down

Topic: Microsoft Visual Basic 2010 Express + Motor (Read 968 times) previous topic - next topic



http://www.youtube.com/watch?v=pkl9wr9m24Q&list=UU9GEsndKESVYvn2xl1ak40A&index=1

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 http://www.dfrobot.com/wiki/index.php?title=Arduino_Motor_Shield_%28L293%29_%28SKU:_DRI0001%29
Code: [Select]
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

Code: [Select]
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
I'm deaf.

www.christian-elektronik.de

Go Up