ok…
now i use back the ps2 controller program that generated by powerpod.
i have delete all those controlling command but i still left all the variable or pin assign.
So now when i start my program, my robot is only “All = 1500” position and if i click any button on PS2 and it won’t be have any respond.
So first of all, i put in the sqaure button command which i already understand:
if (DualShock(2).bit7 = 0) and LastButton(1).bit7 then ;Square Button test
gosub All1500
;Learning to fly posture (uh ? nutty ?...it CAN fly...)
for Index = 1 to 4
serout SSC32,i38400,"#",MRHV,MRHV2,"P1900#",MRK,MRK2,"P1800#",MLHV,MLHV2,"P1100#", |
MLK,MLK2,"P1200T288",13]
serout SSC32,i38400,"#",RRHV,RRHV2,"P1600#",RRK,RRK2,"P1600#",FRHV,FRHV2,"P1600#", |
FRK,FRK2,"P1600#",RLHV,RLHV2,"P1400#",RLK,RLK2,"P1400#",FLHV,FLHV2,"P1400#", |
FLK,FLK2,"P1400T576",13]
pause 288
serout SSC32,i38400,"#",MRK,MRK2,"P1200#",MLK,MLK2,"P1800T288",13]
pause 288
serout SSC32,i38400,"#",RRHV,RRHV2,"P1400#",RRK,RRK2,"P1400#",MRHV,MRHV2,"P1500#", |
FRHV,FRHV2,"P1400#",FRK,FRK2,"P1400#",RLHV,RLHV2,"P1600#",RLK,RLK2,"P1600#", |
MLHV,MLHV2,"P1500#",FLHV,FLHV2,"P1600#",FLK,FLK2,"P1600T576",13]
pause 576
next
serout SSC32,i38400,"#",MRHV,MRHV2,"P1800#",MRK,MRK2,"P1800#",MLHV,MLHV2,"P1200#", |
MLK,MLK2,"P1200T288",13]
pause 288
gosub All1500
endif
then i download it into atom, and yes when i click square button i does something that original does and that is learning to fly.
Then after that i delete the sqaure button code, and i try to put in the walking forward code.
I not really understand how the walking forward program look like, so i try this code in my main program.
[code] YSpeed = (DualShock(3) - 128)*3/5 ; Right Stick Horizontal
XSpeed = (DualShock(4) - 128)*4/5 ; Right Stick Vertical
Steering = DualShock(5) - 128 ; Left Stick Horizontal
StepFlag = (GaitSpeedTmp - 2) max 3
if HeightAdjust or LockLegs then
Height = LastHeight + (((DualShock(6) - 128) / 5) - LastHeight) / StepFlag; Left Stick Vertical
endif
Height = (Height Max HeightLimit) min - HeightLimit[/code]
But after that i download into my atom, moving my left or right stick, it does’nt show any respond on my robot.
What i think was my program on top has problem.
I have also attach my program code, just if someone free please help me check my code whether i have made some mistake in my programming code.
For now, i just hope to understand how the walking forward programming works in PS2 control.
self program.bas (13.1 KB)