Public Class Form1

    Dim WithEvents RC As New iRobots.RoCar01

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim a As Integer

        For i = 1 To 5
            a = InputBox("請輸入動作代碼", "RoCAR也能玩男生女生配")

            Select Case a
                Case 1
                    RC.MoveC("F")
                    RC.WaitN(500)
                    RC.MoveC("X")
                    RC.MusicOut(10, 100)
                Case 2
                    RC.MoveC("B")
                    RC.WaitN(500)
                    RC.MoveC("X")
                    RC.MusicOut(10, 50)
                    RC.MusicOut(10, 50)
                Case 3
                    RC.MoveC("L")
                    RC.WaitN(500)
                    RC.MoveC("X")
                    RC.MusicOut(270, 100)
                Case 4
                    RC.MoveC("R")
                    RC.WaitN(500)
                    RC.MoveC("X")
                    RC.MusicOut(270, 50)
                    RC.MusicOut(270, 50)
                Case Else
                    MsgBox("請重新輸入", , "RoCAR也能玩男生女生配")
            End Select
        Next
    End Sub
End Class
