Atom PRO: HSERVO is not working. This is a continuation of the problem report in the IDE v8.0.1.3 bug thread.
I am getting a continuous reset when HSERVO code is active.
Code is below:
[code]TRUE con 1
FALSE con 0
’
’ Control for serial output
’
debugoutput var bit
’
’ Begin BRAT Configuration
’
’ Servo Configuration
RightHipV con P0
RightHipVOffs con 0
RightKnee con P1
RightKneeOffs con 0
RightAnkle con P2
RightAnkleOffs con 0
LeftHipV con P4
LeftHipVOffs con 0
LeftKnee con P5
LeftKneeOffs con 0
LeftAnkle con P6
LeftAnkleOffs con 0
’ We need two servo groups (P0 - P7)
HSERVO_GROUPS con 2
’
’ Joint move speed
’ Variables
MoveSpd var byte ’ Joint move speed
RightHipVPos var word
RightKneePos var word
RightAnklePos var word
LeftHipVPos var word
LeftKneePos var word
LeftAnklePos var word
’
’ End BRAT Configuration
debugoutput = TRUE ’ Turns on(1)/off(0) serial output to console (serout)
’
if debugoutput then
serout S_OUT, I9600, “I am now active”, 13]
endif
'*************************************** TESTING CODE *****************************************************
enablehservo ’ Turn on HSERVO
RightHipVPos = 0
RightKneePos = 0
RightAnklePos = 0
LeftHipVPos = 0
LeftKneePos = 0
LeftAnklePos = 0
MoveSpd = 63
hservo [RightHipV\RightHipVPos + RightHipVOffs\MoveSpd, RightKnee\RightKneePos + RightKneeOffs\MoveSpd, RightAnkle\RightAnklePos + RightAnkleOffs\MoveSpd, LeftHipV\LeftHipVPos + LeftHipVOffs\MoveSpd, LeftKnee\LeftKneePos + LeftKneeOffs\MoveSpd, LeftAnkle\LeftAnklePos + LeftAnkleOffs\MoveSpd]
while 1
pause 500
wend
'*************************************** TESTING CODE *****************************************************[/code]
8-Dale