well, im back, and i started to modify the Hex code, and im stumped, heres a section of the code that i modified
[code]-----------Init SSC-32 with pulse offsets
serout p15,i38400,"#",LA,LA2,“po-67 #”,LK,LK2,“po-34 #”,LH,LH2,“po-40 #”, |
RA,RA2,“po34 #”,RK,RK2, “po-67 #”,RH,RH2,“po-79 #”, 13]
;SSC-32 -> H3 engine
gosub H3Init
LegUpShift = (LegUpShiftMin + LegUpShiftMax) / 2
;--------------------------------------------------------------------
;-------------Main loop
main
;DS2
gosub Ps2Query
if (DualShock(2).bit4 = 0) and LastButton(1).bit4 then ;Triangle Button test
FlagOff = FlagOff ^ 1
if FlagOff then
Gosub InitPos
Nap 3
serout p15,i38400,"#",LA,LA2,"po-67 #",LK,LK2,"po-34 #",LH,LH2,"po-40 #", |
RA,RA2,"po34 #",RK,RK2, "po-67 #",RH,RH2,"po-79 #", 13]
else
gosub H3Init
endif
endif
if FlagOff then
pause 165
goto OffEnd
endif
if (DualShock(2).bit5 = 0) and LastButton(1).bit5 and (MovesDelai = 0) then ;Circle Button test
gosub All1500
endif
if (DualShock(2).bit6 = 0) and LastButton(1).bit6 and (MovesDelai = 0) then ;Cross Button test
gosub All1500
gosub Ps2Query ;Ask PS2 pad to keep wireless communication on
;Attack posture
serout p15,i38400,"#",MRHH,MRHH2,"P1800#",MRHV,MRHV2,"P1700#",MRK,MRK2,"P1700#",MLHH,MLHH2,"P1200#", |
MLHV,MLHV2,"P1300#",MLK,MLK2,"P1300T288",13]
nap 4
serout p15,i38400,"#",MRHV,MRHV2,"P1500#",MRK,MRK2,"P1500#",MLHV,MLHV2,"P1500#",MLK,MLK2,"P1500T288",13]
nap 4
gosub Ps2Query ;Ask PS2 pad to keep wireless communication on
serout p15,i38400,"#",RRHV,RRHV2,"P1800#",RRK,RRK2,"P1800#",MRHV,MRHV2,"P1400#",MRK,MRK2,"P1400#", |
FRHH,FRHH2,"P1800#",FRHV,FRHV2,"P2100#",RLHV,RLHV2,"P1200#",RLK,RLK2,"P1200#", |
MLHV,MLHV2,"P1600#",MLK,MLK2,"P1600#",FLHH,FLHH2,"P1200#",FLHV,FLHV2,"P900T288",13]
nap 4
for Index = 1 to 10
serout p15,i38400,"#",FRHH,FRHH2,"P1700#",FRHV,FRHV2,"P2000#",FRK,FRK2,"P1600#", |
FLHH,FLHH2,"P1300#",FLHV,FLHV2,"P900#",FLK,FLK2,"P1600T144",13]
nap 3
serout p15,i38400,"#",FRHH,FRHH2,"P1800#",FRHV,FRHV2,"P2100#",FRK,FRK2,"P1400#", |
FLHH,FLHH2,"P1200#",FLHV,FLHV2,"P1000#",FLK,FLK2,"P1400T144",13]
nap 3
gosub Ps2Query ;Ask PS2 pad to keep wireless communication on
next
serout p15,i38400,"#",FRHH,FRHH2,"P1500#",FRHV,FRHV2,"P2100#",FRK,FRK2,"P1500#", |
FLHH,FLHH2,"P1500#",FLHV,FLHV2,"P900#",FLK,FLK2,"P1500T288",13]
nap 4
serout p15,i38400,"#",RRHV,RRHV2,"P1500#",RRK,RRK2,"P1500#",MRHV,MRHV2,"P1500#",MRK,MRK2,"P1500#",FRHV,FRHV2,"P1500#", |
MLHV,MLHV2,"P1500#",MLK,MLK2,"P1500#",FLHV,FLHV2,"P1500#",RLHV,RLHV2,"P1500#",RLK,RLK2,"P1500T576",13]
nap 5
gosub Ps2Query ;Ask PS2 pad to keep wireless communication on
serout p15,i38400,"#",MRHH,MRHH2,"P1500#",MRHV,MRHV2,"P1700#",MRK,MRK2,"P1700#", |
MLHH,MLHH2,"P1500#",MLHV,MLHV2,"P1300#",MLK,MLK2,"P1300T288",13]
nap 4
serout p15,i38400,"#",MRHV,MRHV2,"P1500#",MRK,MRK2,"P1500#",MLHV,MLHV2,"P1500#",MLK,MLK2,"P1500T288",13]
nap 4
gosub Ps2Query ;Ask PS2 pad to keep wireless communication on
endif[/code]
now i changed the variables and constants to accomadate the BRAT instead of the hex, but i dont understand some of it, like in the “crossbutton test” like you’ll see in the in the above code, how do i get the servos into that postion? is it like a “throw in a number and see wat it looks like and it if doesn’t meet what you are doing then change the number and see wat it looks like then, if it doesn’t” ect, ect, or is it reverse kinetics?
i know, im being vauge, but im not seeing wat most of this code means , i get the normal jist of it, idk, maybe ill just try to make my own simpler code, tackling a button on the PS2 controller at a time
itd help with my programming skills too