Shop OBEX P1 Docs P2 Docs Learn Events
help with paintball gun trigger progect project before i spend money i dont have — Parallax Forums

help with paintball gun trigger progect project before i spend money i dont have

blink13blink13 Posts: 65
edited 2005-03-18 04:25 in BASIC Stamp
I am tryin to write (what should be a simple program)·a program in order to controll what·the action of the pushbotton will be(lets call this·button A) by the press of another pushbutton (button B) i have tried many programs but none seem to work i am using a homework board which uses BS2 language please help me befor i by a basic stamp. This will be powering a solenoid so that my paintball gun can shoot auto semi auto and bursts (i dont want to spend 300 bucks on one made by tippmann)

please help
«1

Comments

  • MacGeek117MacGeek117 Posts: 747
    edited 2005-01-28 00:37
    blink13, please post your program.
    bugg

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    So many projects, so little time.
  • blink13blink13 Posts: 65
    edited 2005-01-28 00:42
    yeh il rewrite it but i jus started progrming this week so be prepared if it sux
  • blink13blink13 Posts: 65
    edited 2005-01-28 00:52
    '{$STAMP BS2}
    '{$PBASIC 2.5}
    IF IN4 THEN
    GOTO 1
    endif
    1:
    IF IN0 THEN
    endif
    do
    HIGH 3
    PAUSE 100
    LOW 3
    loop
    2nd push:
    IF IN4 THEN
    GOTO 2
    endif
    2:
    FOR counter = 1 TO 6
    HIGH 3
    PAUSE 100
    LOW 3
    next
  • blink13blink13 Posts: 65
    edited 2005-01-28 00:53
    but i dont know if that will stop turning on and of after i lift from the button that starts the oscelation(sorry for my spellin)
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-28 02:25
    Can you define your "problem" more clearly? It has been a long day and I cannot make heads nor tails of your question or program.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • blink13blink13 Posts: 65
    edited 2005-01-28 02:33
    yeh sure, what i am trying to do is controll the affects that one butten will have with the push of another. and i tried to do it by using th IN command with the pin being used with the pushbutten (the pushbutton is set up like the one in the reding a pushbutton in the book what is a microcontroller) when that button is pushed i want it to change what another button is doing i have called tech support but they suggested going here. i am new to programming this device and started a week ago. when i run this program it conferms a programs running but it does not do anything when i push the button accept for turn off the light that shows the program is running if you have any ideas on a different command i should be using or if my programming is just wrong i will greatly appreciat it.
  • blink13blink13 Posts: 65
    edited 2005-01-28 02:34
    * reading
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-28 02:37
    I'm still looking for an explanation....

    Something like this: When button A is pressed, a press of button B does X. When button A is NOT pressed, a press of button B does Y. And ... do you want active-high or active-low inputs. This is the trickiest part of programming: clearly defining the problem.

    I'm sure it will be easy to solve once the definition is understood.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • blink13blink13 Posts: 65
    edited 2005-01-28 02:43
    oh sorry,

    the generall idea of what i want to do is controll a solenoid in my paintball gun this will release the cock causing my gun to fire.
    i want to controll the solenoid with abutton attached to the microconrteroller
    but in my plan i ran into a delema. this was what i do if i want to shoot semi auto or in bursts to do this i wanted to use a second button to change the output of button B which would then make it only shoot six at a time or 1 at a time i have no idea how to do this
  • blink13blink13 Posts: 65
    edited 2005-01-28 02:46
    the first button i refered to was button B
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-28 04:41
    I think I may understand what you want ... perhaps I'm just dense.· This is what I understand:

    If the mode input is off, then you can only fire one shot at a time -- you must release the trigger between shots.· When the mode switch is in semi-auto, you want to burst six shots at a time.· After that you have to release the trigger before the next burst.

    The attached program may look a little advanced but trust me, this is how it should look.· Please don't fall into the trap of using lines like

    · IF IN4 = 1 ....

    This is lazy, sloppy coding, and will just lead to troubles as your programs grow and you have to make changes.· Learn to define your IO pins, your constant values, and give your variables (in fact, everything) meaningful names.· The few minutes you spend up front doing this will make your program much easier to construct and debug.· We have a document on our web site called "The Elements of PBASIC Style" (it's also in our help file).· Read it.· Apply the guidelines and save yourself a whole bunch of headaches later.

    Good luck with your project.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA


    Post Edited (Jon Williams) : 1/28/2005 4:43:59 AM GMT
  • blink13blink13 Posts: 65
    edited 2005-01-28 12:47
    thankyou veryy much i will try it
  • blink13blink13 Posts: 65
    edited 2005-01-28 21:17
    i tried that by saying
    IF IN4=1 Then
    DO
    HIGH 3
    PAUSE 100
    LOW 3
    LOOP UNTIL
    IN4= 0
    END
    but thus dident work, i have actually figured out a differnt way to change how many times it shoots but that does not have to do with proggraming
  • nick bernardnick bernard Posts: 329
    edited 2005-01-28 22:11
    blink,
    what kind of solenooid are you using? what kind of gun you have? did you have do any other mods to the trigger assembly?
    how did you make sure that you're not push (or pulling) the solenoid faster than the gun fires?
    i just bought a spyder and was pondering a similar mod my self. any help?
    if you could help me understand the mechanics i should be able to help you develop better firing algorithms

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    League Bowling.... it's not a sport, it's a way of life
  • blink13blink13 Posts: 65
    edited 2005-01-29 03:33
    Nick,
    actually i have a tipmann which has plenty of room in the handel for a solenoid as long as it is less than half an inch in diameter and pushes with a returm string . Spiders are much more complicated than tippmans and probably cant be modded unless you by a new trigger frame (which can be done) but the electric triggers for them are much cheaper. for a tipmann a trigger is like 300$ but a spiders is about a hundred bucks. another great thing about tipmanns is that they fire as fast as you can pull the trigger (within reason) i plan to use a DO LOOP command for full auto and a HIGH command for semi and a COUNTER for bursts. i plan two use basic stamp but i am prototyping with a Homework board. if you have any questions about paintball just ask but i really need help with my program so please respond if you know of a command i could use inorder to get the solenoid to start when a button is pushed. if i finish this project succsesfully i will try to post it under the projects forum
  • blink13blink13 Posts: 65
    edited 2005-01-29 16:24
    oh yeh and what could i do so that when the button is pushed it turns on and off the output or the solenoid to achieve full auto i cant get anything to work
  • Shawn LoweShawn Lowe Posts: 635
    edited 2005-01-29 22:02
    Did johns program not work?
    Shawn

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Shawn Lowe


    Remember - No matter where you go
    There you are.
  • nick bernardnick bernard Posts: 329
    edited 2005-01-31 15:58
    Lets verify your circuit to make sure we all understand each other.

    does your circuit look anything like this?
    are your inputs active high or low?
    what are the specs on your solenoid?
    etc....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    League Bowling.... it's not a sport, it's a way of life
  • blink13blink13 Posts: 65
    edited 2005-01-31 20:22
    no but ill try it
  • blink13blink13 Posts: 65
    edited 2005-01-31 20:25
    mine is a pushbutton going to a pin on the stamp and then when that read's zero it outputs to the solenoid but i am prototyping with an led
  • blink13blink13 Posts: 65
    edited 2005-01-31 20:37
    i dont have anything that can produce images like that , what is the program called
  • nick bernardnick bernard Posts: 329
    edited 2005-01-31 22:03
    i use ExpressSCH
    http://www.expresspcb.com/ExpressPCBHtm/Download.htm

    there is an "export to bitmap" option under File that generates a bitmap.
    i crop and edit the bitmap with paint to center in on the ckt before i post.

    but you could even just open my doc with paint and move stuff about.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    League Bowling.... it's not a sport, it's a way of life
  • blink13blink13 Posts: 65
    edited 2005-01-31 22:48
    thnx
  • blink13blink13 Posts: 65
    edited 2005-01-31 22:49
    shawn, it worked but the hole purpos of havin an electric trigger is to shoot auto andthat only shoots semi.
  • blink13blink13 Posts: 65
    edited 2005-01-31 22:51
    that program wont run on my comp it says its unsuitable.
  • nick bernardnick bernard Posts: 329
    edited 2005-02-01 14:13
    the scipt is the easiest part of this project. johns code will work we just need to make sure that the parity of your inputs is correct and the the circuit functions like you need it too. use paint or express sch to mock up a schematic and make sure that you label your inputs. also describe the behavior of the outputs with all input possibilities including what happens when you hold buttons down for various durations if applicable. you should also get your hands on a solenoid to test with.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    League Bowling.... it's not a sport, it's a way of life
  • blink13blink13 Posts: 65
    edited 2005-02-03 00:52
    i am planning on getting a solenoid but johns program did not work for some reason+ i am a noobie but i gave it a shot heres a crappy schematic but regularily the button will have 4 pins
    but it wont send, ill explain it it is a button going to the bs1 which then goes to a solenoid i dont have paint becuase my comp was just wiped.
  • nick bernardnick bernard Posts: 329
    edited 2005-02-03 14:01
    do you have a bs1?
    because john's script is for a bs2

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    League Bowling.... it's not a sport, it's a way of life
  • blink13blink13 Posts: 65
    edited 2005-02-03 22:39
    no i am prototyping with a bs2 homework board and it did not works
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-02-04 00:54
    If you're a noobie, perhaps you ought to step back for a moment and work through the WAM (What's A Microcontroller?) book ... it will save you a lot of frustration later.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
Sign In or Register to comment.