Pages: [1]   Go Down
Author Topic: Microsoft Visual Basic 2010 Express + Motor  (Read 816 times)
0 Members and 1 Guest are viewing this topic.
Germany
Offline Offline
Jr. Member
**
Karma: 1
Posts: 55
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset





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:
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:
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
Logged


Pages: [1]   Go Up
Jump to: