Shop OBEX P1 Docs P2 Docs Learn Events
Trying to build a "pinspotter" simulator - newbie - any help is appreciated! — Parallax Forums

Trying to build a "pinspotter" simulator - newbie - any help is appreciated!

wb8yjfwb8yjf Posts: 4
edited 2004-08-03 00:47 in BASIC Stamp
Hi all, I am a newbie to the stamps, I have over 30 years experience in electronics though. Here is what I am trying to do: I service bowling alley electronics and am trying to make a stamp based "pinspotter" simulator. I already have the assembly built complete with LCD and 4 buttons for inputs as well as a relay driver for outputs. Operation of a pinspotter is pretty straightforward, basically no more than 8 inputs (6 of which determine where the table· & sweep positions during the machine cycle) and the outputs are (2) 110VAC to run 2 motor/gear assys.·and a few 12VDC for lights.· My goal is to have a system where a menu scrolls thru 4 screens with various operations (ie: 1st ball cycle, 2nd ball cycle, strike, etc). I want to set the menus up with 3 options and a "next menu" screen, after going thru all 4 screens, back to the 1st.· I believe this could all be done with sub routines selected by a corresponding switch and then sequencing the relays in the proper order to simulate the inputs on the machine. One thing I can't seem to grasp is scanning the switches while the menu(s) are being displayed and how to "stop" the displayed menu and wait for a switch to be pressed to move on to the next menu or go to the subroutine..I know this is a lot easier than I'm thinking, but with all the electronics floating around in my noodle, I am blanking out on writing code...freaked.gif· I have gotten to the point where I can sequence the relays in what ever order I want and the timing of them too. Any suggestions? This thing would make my life a LOT easier! Now I have to physically put the control chassis on a pinspotter and run it at the bowling alley..pain in the Smile (PLUS a lot of driving). BTW, the outputs of the controller aren't connected to the stamp controller at this time. I would like to monitor them via opto couplers to display a fault (ie: timing is no good).

Can anyone point me the right way?

The stamp is a BS2E.

Thanks!
Jon aka wb8yjf

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-07-31 21:22
    I wrote this sometime back, but it may help you get ahold of multi-level menus and programming.

    http://www.parallax.com/dl/docs/cols/nv/vol2/col/nv62.pdf

    And yes, subroutines are your friends.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • cabojoecabojoe Posts: 72
    edited 2004-07-31 21:40
    With the BS2E you could run a menu program that can call up any of 7 other programs using two buttons. This isn't exactly what you are asking for, but maybe you could noodle out a way to make this work for you. Here's an snippet of my robot's menu program (lifted from Lynxmotion's Hexapod software) to give you an idea of what you might do.

    PAUSE 1000 'Initialize lcd
    SEROUT lcd,Baud,[noparse][[/noparse]4,12,14]
    SEROUT lcd,Baud,[noparse][[/noparse]"**JoeMarsRover**"]
    PAUSE 3000


    SEROUT lcd,baud,[noparse][[/noparse]4,12,14,"HELLO EARTHLING"]

    FOR b=1 TO 5000 'Display greeting and allow quick menu selection.
    IF IN4=0 THEN menu1
    NEXT



    menu: 'Menu start
    IF IN4=0 THEN menu
    IF IN5=0 THEN menu
    SEROUT lcd,Baud,[noparse][[/noparse]1,"HELLO EARTHLING Press A for Menu"]

    menua:
    IF IN4=0 THEN menu1
    GOTO menua

    menu1:
    IF IN4=0 THEN menu1 'This assures the button is released.
    IF IN5=0 THEN menu1
    SEROUT lcd,Baud,[noparse][[/noparse]1,"*RangeNDriveMix*A=Select B=Next "]

    menu1a:
    IF IN4=0 THEN rangendrive
    IF IN5=0 THEN menu2
    GOTO menu1a

    menu2:
    IF IN4=0 THEN menu2
    IF IN5=0 THEN menu2
    SEROUT lcd,Baud,[noparse][[/noparse]1,"*****JOEARM*****A=Select B=Next "]

    menu2a:
    IF IN4=0 THEN Joearm
    IF IN5=0 THEN menu3
    GOTO menu2a

    menu3:
    IF IN4=0 THEN menu3
    IF IN5=0 THEN menu3
    SEROUT lcd,Baud,[noparse][[/noparse]1,"****JoeSFR08****A=Select B=Next "]

    menu3a:
    IF IN4=0 THEN joesfr08
    IF IN5=0 THEN menu4
    GOTO menu3a

    menu4:
    IF IN4=0 THEN menu4
    IF IN5=0 THEN menu4
    SEROUT lcd,Baud,[noparse][[/noparse]1,"**JoeSFR08Sound*A=Select B=Next "]

    menu4a:
    IF IN4=0 THEN joesfr08sound
    IF IN5=0 THEN menu5
    GOTO menu4a

    menu5:
    IF IN4=0 THEN menu5
    IF IN5=0 THEN menu5
    SEROUT lcd,Baud,[noparse][[/noparse]1,"***SPEEDRANGER**A=Select B=Next "]

    menu5a:
    IF IN4=0 THEN speedranger
    IF IN5=0 THEN menu6
    GOTO menu5a

    menu6:
    IF IN4=0 THEN menu6
    IF IN5=0 THEN menu6
    SEROUT lcd,Baud,[noparse][[/noparse]1,"SerialReceiver1 A=SELECT B=NEXT "]

    menu6a:
    IF IN4=0 THEN SerialReceiver
    IF IN5=0 THEN menu
    GOTO menu6a

    'menu7:
    'IF IN4=0 THEN menu7
    'IF IN5=0 THEN menu7
    'SEROUT lcd,Baud,[noparse][[/noparse]1,"Remote Control A=Select B=Next "]

    'menu7a:
    'IF IN4=0 THEN remote
    'IF IN5=0 THEN menu8
    'GOTO menu7a

    'menu8:
    'IF IN4=0 THEN menu8
    'IF IN5=0 THEN menu8
    'SEROUT lcd,Baud,[noparse][[/noparse]12,"Sounds A=Select B=Next "]

    'menu8a:
    'IF IN4=0 THEN sounds
    'IF IN5=0 THEN menu9
    'GOTO menu8a

    'menu9:
    'IF IN4=0 THEN menu9
    'IF IN5=0 THEN menu9
    'SEROUT lcd,Baud,[noparse][[/noparse]12,"BotReceiver A=Select B=Next "]

    'menu9a:
    'IF IN4=0 THEN receiver
    'IF IN5=0 THEN menu10
    'GOTO menu9a

    'menu10:
    'IF IN4=0 THEN menu10
    'IF IN5=0 THEN menu10
    'SEROUT lcd,Baud,[noparse][[/noparse]12,"UltRangerSSC A=Select B=Next "]

    'menu10a:
    'IF IN4=0 THEN ultranger
    'IF IN5=0 THEN menu


    See if this makes any sense to you...If you can break up your operations into 7 programs then with a menu program you can call any of those operations(programs) with a menu such as this. Hope this helps
  • wb8yjfwb8yjf Posts: 4
    edited 2004-07-31 21:46
    THANKS for the posts guys! Jon, I printed out the tutorial and Cobojoe, I'll try messing a little with your idea as well. One thing I have learned is plugging the stamp in & doing trial and error stuff. Seems I learn it faster and in more detail when I can see exactly what happens when I try something new or fudge it. I have determined that 9 subroutines will do the job for this project & will cover everything I need it to do. Up to now the only testers like this are a hodge podge of motors, switches, lights, and wires...I think the Stamp will be PERFECT for this job.

    Glad to see another Jon who knows how to spell the name too!burger.gif
  • cabojoecabojoe Posts: 72
    edited 2004-07-31 21:49
    Motors, switches, lights and wires RULE cool.gif
  • wb8yjfwb8yjf Posts: 4
    edited 2004-07-31 21:52
    You would absolutly LOVE this industry! I was at a bowling alley this week that has controllers consisting of 32 3PDT relays and 2 30 step stepper relays! Noisy lil buggers...turn.gif Circa 1956...
  • hutdonhutdon Posts: 32
    edited 2004-08-03 00:14
    When you say 'chassis' it sure sounds like your talking about AMF's - probably 82-70's. This would make a great project. I can remember working on these beasts. If you couldn't see anything broken the next step was to change the chassis. (Even when you only had one spare and you had already swapped 7 machines!) - Don
  • wb8yjfwb8yjf Posts: 4
    edited 2004-08-03 00:47
    Don,
    YEP, you are correct! Those are the chassis I need this tester for. I don't want to go the old way and use a hodge podge of motors, lights & switches...I figured the Stamp would be perfect for this task! I just got done working on two of those beasts..great fun..freaked.gif· Now that the time has come for the season to start soon, I'm swamped all over again! Hopefully I can get this project completed ASAP! Where did you work?

    Jon
Sign In or Register to comment.