' This program controls 2 DC motors connected ' to h-bridge chips U3 and U4 on the OOBOT40 board. ' Ramps the motor speeds up and down, and forwards ' and backwards. ' ' for motor A (using h-bridge U3): ' - jumper J8-0 to J8-1 (lower-to-middle). ' - connect motor at HDR3 M1 to M2. ' - connect motor battery at +M to gnd. ' ' for motor B (using h-bridge U4): ' - jumper J9-0 to J9-1 (lower-to-middle). ' - connect motor at HDR4 M5 to M6. Dim A As New oDCMotor2 Dim B As New oDCMotor2 Dim x As New oByte Sub Main() ' set up motor A. A.IOLineP = 18 ' PWM1 to U3 enable 1. A.IOLine1 = 24 ' U3 In1. A.IOLine2 = 25 ' U3 In2. A.Operate = 1 A.Brake = cvOff ' set up motor B. B.IOLineP = 17 ' PWM2 to U4 enable 1. B.IOLine1 = 28 ' U4 In1. B.IOLine2 = 29 ' U4 In2. B.Operate = 1 B.Brake = cvOff Do For x = -100 To 100 A = x B = x OOPic.Delay = 2 Next x For x = 100 To -100 step -1 A = x B = x OOPic.Delay = 2 Next x Loop End Sub