Hi,
I'm getting some strange errors. Can someone assist in what's wrong with this code...
Error:
Code (error on the word "Do") :
I'm getting some strange errors. Can someone assist in what's wrong with this code...
Error:
B4X:
Parsing code. 0.02
Compiling code. Error
Error compiling program.
Error description: Object reference not set to an instance of an object.
Occurred on line: 428
Do
Word: do
Code (error on the word "Do") :
B4X:
Sub btnLeft_Click
btnStop_Click
NewServiceMessage("Turning Left " , "", 1, 1000)
Dim lCurrentHeading As Long
Dim lTargetHeading As Long
Dim lAdjustedHeading As Long
lTargetHeading = lCurrentHeading - lTurnDegrees
If lTargetHeading < 0 Then
lTargetHeading = lTargetHeading + 360
End If
Do
lCurrentHeading = Heading
If lTargetHeading > (360 - lTurnDegrees) AND lCurrentHeading < lTurnDegrees Then
lCurrentHeading = lCurrentHeading + 360
End If
pinMotor4.DutyCycle = CurrentDutyCycle
pinMotor3.DutyCycle = CurrentDutyCycle
Loop While (lCurrentHeading < lTargetHeading)
End Sub