Does this look like it would work

JCTH

New Member
I started writing a code for my pic to put inside of my controller to perform certain button combos.

Pin 0= External button
Pin 1= A button on controller
Pin 2= B button on controller

Desired macro I want pic to perform when external button is pressed is AB.

Here is the code I have came up with so far. Any help would be very appreciated :)

main:
if pin0 = 1 then gosub dsm 'pin0, button to activate macro
goto main

dsm: high 1 'pin1 connects to button "A"
Pause 50
Low 1
pause 50
high 1
pause 50
low 1
pause 50
high 2 'Pin2 connects to button "B"
pause 50
low 2
return
 

Brietech

Senior Member
that looks like it will work. Your main problem will probably be physically interfacing them, not writing the appropriate code.
 
Top