Beta Phoenix 2.1 code

The serout you mentioned for the HeadPanAngle and HeadTiltAngle as you know are specific to the SSC-32 versions of the code. If I were doing it, where those lines of code are in the main core (or PS2 control) code, I would probably add it conditionally (depending on something like is the servos defined) with some form of Gosub that did this like: gosub UpdatePanandTiltAngles[HeadPanAngle, HeadTiltAngle]

I would then implement this function in the driver files (SSC-32 and Arc32). You have the basics of the SSC-32 version there. What you need to do for the Arc32 is to convert this to the HSERVO command. As you probably know the HSERVO coordinate space is different than the SSC-32. SSC-32 the coordinates are in uS centered at 1500, whereas the HSERVO is in clock ticks minus the number of clock ticks in 1500us (ie 0 is the center point). I believe the conversion for the Arc32 is: (x * 20) - 3200 where x is the number of us.

Several threads talking about HSERVO including: viewtopic.php?f=4&t=3224

Good Luck
Kurt

Ok, I till try to get this working one step at a time. The first part I tried is to try to activate speaker and eyes using L3. I added this code to PS2 control.

PTMode         		con 5
	
;PTMode
	IF (DualShock(1).bit1 = 0) and LastButton(0).bit1 THEN	;L3 Button test
		  sound cSpeakerPin, [50\1000]
	 IF ControlMode <> PTMode THEN
	    ControlMode = PTMode
	    IF (SelectedLeg=255) THEN
	    ELSE
	      ControlMode = SingleLegMode
	    ENDIF
          ENDIF
	ENDIF


;[PTMode]	
	IF (ControlMode=PTMode) THEN
	    pause 100
	    sound cSpeakerPin, [50\2000]
	    low cEyesPin
            pause 100
            sound cSpeakerPin, [50\4000]
            high cEyesPin
    ENDIF 

What I am seeing is it seems to detect the button push, it stops the walking mode, but it doesn’t activate sound or eyes. So i am not sure why it doesn’t get to the PTMode.
The second problem is it will not exit the PTMode by pressing L3 again, it will exit to a different mode so I think it is not detecting lastbutton. Thanks for any help.

A quick look through your code, you have bits and pieces of other code, and may have some other side effects…

Maybe it should look more like:

[code] PTMode con 5

;PTMode
   IF (DualShock(1).bit1 = 0) and LastButton(0).bit1 THEN   ;L3 Button test
      sound cSpeakerPin, [50\1000]
      IF ControlMode <> PTMode THEN
         ControlMode = PTMode
      ELSE
         ControlMode = WalkMode
      ENDIF
   ENDIF

;[PTMode]   
   IF (ControlMode=PTMode) THEN
       pause 100
       sound cSpeakerPin, [50\2000]
       low cEyesPin
            pause 100
            sound cSpeakerPin, [50\4000]
            high cEyesPin
    ENDIF

[/code]
But would probably need to make sure the code is positioned in the right places… Such that it can execute…

Kurt

That did help, I am able to get in and out of the commands using the L3 now. I am getting some unexpected leg movement but I will look at where the code is positioned to see if I can eliminiate it.

Thanks
Don

Revised
The unexpected leg movement was a dead battery not code position. It seems like it is working as expected. I can work on the next part, Yea!
Thanks

I thought I should mention, that for many projects such as this, you probably should look for the latest software up at the Lynxmotion Github account: github.com/lynxmotion

Kurt

Thank for the location. I tried to modify the existing code and did get it to work. But it was not very clean and if there is a new version I did not want to need to add all the changes again. I also liked the idea of being able to use it only if needed, so I tried a different route by making a seperate file to hold the Pan and tilt changes and use a gosub to get to it. I am sure it could be made better but It seemed to work ok. I uploaded it in case it may be helpful. Thanks
phoenix_PandT_Mod.bas (1.59 KB)