Listing 9.1: Cut and paste this program into the code window of the OOPic Multi-language Compiler
Dim S As New oSerialx Sub Main() Do 'Motor 1 'Motor 2 End Sub'A motor control program using the Pololu
'micro dual serial motor controller and
'the oSerialx object.
Dim R As New oDio1
R.IOLine = 31
S.Baud = cv4800
S.IOlineS = 30
S.Operate = cvTrue
R.Direction = cvoutput
OOPic.Delay = 50
R.Invert 'Invert reset pin
S.Value = 128 'Start byte
S.Value = 0 'Device type (motor)
S.Value = 0 'Motor and direction
S.Value = 127 'Motor speed (between 0 - 127)
S.Value =128 'Start byte
S.Value = 0 'Device type (motor)
S.Value = 3 'Motor and direction
S.Value = 127 'Motor speed (between 0 - 127)
OOPic.Delay = 500
Loop