Programming assistance (CH3-R PS2)

How would you modify the Ch3-r’s code so that the R1 button controls the gun, and the right analogue stick controls the pan tilt setup?

properly best to start a new thread on this. :neutral_face:

first:
by saying controls the gun. what do you mean?
second
how do you want it controlled and what “gun” is it you’ve connected?
third
how is R1 to be used?

i take it you mean firing it…?
best look in the** brat mech** link:
viewtopic.php?f=7&t=5224

forth
i can help you with a pan and tilt here is a simple code that works. but you will find this code in the Ch3-r code genorated by the FREE powerpod program. pan and tilt code.bas (6.2 KB)
the code i have attached uses ABB2-BAP with SSC-32 and ps2 remote.
lynxmotion.com/Product.aspx? … egoryID=15

Done. 8)

  1. It can turn on and off the airsoft gun
  2. Relay mechanism
  3. it is to be used as the fire button.

im guessing you would need to make the pin high or low to get it to work. maybe using

[code]
gun con “0”
gun2 con “1”;assign pin number here
firegun var bit

if (DualShock(2).bit3 = 0) and LastButton(1).bit3 then ;R1 Button test
firegun = 1
else
firegun = 0
endif

serout SSC32,i38400,"#",gun,gun2,“P”,DEC firegun,“T190”,13][/code]

maybe not but checking the brat codes might give you a better idea.

He may be using a Picoswitch which uses servo pulses to open or close.

Original poster, please provide more information…

I have not built this yet but am planning to, :blush: sorry but I have no info. JUst curious about the code :slight_smile:

How would you use the right analog stick to control the pan tilt mechanism?

ZCoord = Right stick X (left-right)
WCoord = Right stick Y (up-down)

Thanks! But i meant in the code. or is that what you posted?

in the powerpod software it already has pan and tilt written into it. :wink:
lynxmotion.com/Product.aspx? … egoryID=15