Shop OBEX P1 Docs P2 Docs Learn Events
need help with NES gamepad controller program — Parallax Forums

need help with NES gamepad controller program

mrred1983mrred1983 Posts: 3
edited 2012-05-03 20:14 in BASIC Stamp
I am trying to program the Basic stamp 2 to use a NES gamepad controller to control two continuous rotation servos with the D-pad and light an led with the A button. Does anyone know what program codes are needed to make this work? I would appreciate any help that i can get.


NES Gamepad Controller Adapter
Nintendo Gamepad Controller
Board of Education Development Board - Serial Version
BASIC Stamp 2 Module
Parallax (Futaba) Continuous Rotation Servo
' {$STAMP BS2}
' {$PBASIC 2.5}

Comments

  • dandreaedandreae Posts: 1,375
    edited 2010-10-22 10:02
    There is sample code for the BASIC Stamp and the NES controller listed on the NES product page. Here is a link:

    http://www.parallax.com/Portals/0/Downloads/docs/prod/acc/32368-NesGamepadCtrlrAdapter-v1.0.pdf.

    You can use the values to activate the servos by setting up subroutines.

    Dave
  • mrred1983mrred1983 Posts: 3
    edited 2010-10-25 10:12
    i have already used that program. the problem is that i can not figure out how to write a program to be conditional based on the binary input provided by the nes controller. i know which bit is for each button but i can not figure out the synthax that i need to write the program.
  • FranklinFranklin Posts: 4,747
    edited 2010-10-25 12:18
    What are you trying to do exactly?
  • mrred1983mrred1983 Posts: 3
    edited 2010-10-25 12:40
    i am trying to use the d-pad on the controller to control two servos to give me two axis of movement. the up and down buttons will control one servo and hte left and right buttons will control the other. then the A button controls a single led light.
  • CoolNerd27CoolNerd27 Posts: 6
    edited 2012-05-03 20:14
    I am having this same problem. It's because the value from shiftin is not originally in bin or dec format. You only see it as bin in the debug terminal. So you need a command line that converts the value variable to BIN or DEC, which i can not figure out.
Sign In or Register to comment.