Shop OBEX P1 Docs P2 Docs Learn Events
Help with NES controller programming. — Parallax Forums

Help with NES controller programming.

jbriggs1jbriggs1 Posts: 1
edited 2011-03-25 20:47 in BASIC Stamp
My students and I are working on a tethered robot. We are new, and relativley inexperienced with programming and are having difficuluty with designing a program to control a Boe Bot using the NES controller. We have successfully tested the NES and a controller and it is in working order. (RLDUTEBA) are all working correctly. Where we are confused is in developing the programming language that would allow us to control the robot. How/what commands are used to identify the control inputs once the program is working? Could someone please provide a bit of sample programming for us to study and jump off from?

thank you for any assistance.

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-03-25 20:47
    You've used the Parallax source code.
    PULSOUT 5, 10 ' latch data
    SHIFTIN 6, 4, LSBPRE, [value(0) \8] ' shiftin socket1

    So, you end up with input/NES data placed in the variable called "value(0)"
    Instead of DEBUGing that, or in addition to that, you'd make a decision
    about what to do given that data, e.g.:
    IF value(0) = %11101111 THEN Move_Forward ' U was pushed

    Move_Forward, a subroutine, could turn on a motor for a brief period,
    to go forward a brief period, and then the program would check for
    new NES data.
Sign In or Register to comment.