Shop OBEX P1 Docs P2 Docs Learn Events
Simple Question, Please help — Parallax Forums

Simple Question, Please help

zoerrorzoerror Posts: 7
edited 2008-06-08 07:11 in BASIC Stamp
ill get right to the question:

I got to buttons that share the same ground, but have two different leads.
im not sure how to wire it to the stamp board.

Everything i try isnt working, i only want one of the buttons to flash but they both do. i plugged the ground wire that they both share into P15, then i put the lead next to it on the white part, But that leaves the other lead for the other button no where to go. So i tried putting it next to the other one, but then both the buttons light up, i only want one buttong to light up. can anyone help me?

Comments

  • zoerrorzoerror Posts: 7
    edited 2008-06-06 19:36
    pretty much i want to know how to have 2 buttons that share the same ground, but have two different leads, and hook it to the stamp board and have a code somthing like this:
    high 15
    pause 250
    low 15

    but only have the button thats hooked into 15 go off.
  • FranklinFranklin Posts: 4,747
    edited 2008-06-06 19:38
    Hook the shared ground to GROUND and hook the two leads to two different pins.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-06-06 19:38
    Well, you mention that the buttons "Flash" -- usually you push buttons.

    So I'm guessing there's some "light source" inside the buttons that "flash". Well, we need to know if those are lamps, or LED's. And if you have some current limiting device (like a resistor) if they ARE LED's, and how much current they take if they're lamps.
  • zoerrorzoerror Posts: 7
    edited 2008-06-06 19:47
    the buttons im refering to are the buttong on a guitar hero guitar. the green buttong and the blue buttong share the same ground. so when im playing a song, they both hit at the same time. i need to know how to stop that. i have tried various combinations with the three wires, but im dont know what im doing wrong. i have made it so they both stay pressed, i hvae made it where they both will hit at the same time, but i cant figure out how to make it to where only one is pressed without the other one beeing pressed as well.
    maybe its my code or something? im just trying to use somthing simple like this:
    high 15
    pause 250
    low 15
  • zoerrorzoerror Posts: 7
    edited 2008-06-06 20:07
    i put the ground for both of them on the ground for 15. G represents the hot wire for the green button
    15 [noparse]/noparse]-] [color=gray][noparse][[/noparse][color=green]G[/color [noparse][[/noparse] ][/color]
    14 [noparse][[/noparse] ]· [noparse][[/noparse] ]·[noparse][[/noparse] ]
    13 [noparse][[/noparse] ]· [noparse][[/noparse] ]·[noparse][[/noparse] ]
    12 [noparse][[/noparse] ]· [noparse][[/noparse] ]·[noparse][[/noparse] ]
    11 [noparse][[/noparse] ]· [noparse][[/noparse] ]·[noparse][[/noparse] ]

    now where do i put the Blue hot wire? i have tried putting it next the the Green hot but they both will hit at the same time. i have tried connecting the 15 pin with the 14 pin making the share the same ground, and having the blue hot wire under the green hot wire. i cant figure it out.

    i put:

    high 15
    pause 250
    low 15


    i also tried this with them sharing the same ground on 15 and 14:
    high 15
    low 14
    pause 250
    low 15

    but i cant figure this out....
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-06 20:27
    Like the others, I'm not sure what you're talking about. When you say "flash", I assume that you mean that you have some kind of lamp like an LED, yet you talk about a button which implies a pushbutton or other kind of switch to me. You need to clarify that. Are you closing a switch of some kind or lighting up some kind of lamp?

    If you're talking about some kind of lamp, usually the common lead is connected to the Stamp's ground (or Vss) lead. The other lead from the lamp is connected to an I/O pin, usually through some kind of current limiting resistor. For most LEDs, a 330 Ohm resistor is commonly used. Some kinds of Stamp boards (like the HomeWork Board) already have this installed. Most Stamp boards do not have this and you'll have to add your own.

    If your lamp is an LED, but with the common lead connected to the LED anodes (common anode), you'll need to connect the common lead to the Stamp's +5V (or Vdd) lead. The other leads are still connected to I/O pins through a 330 Ohm resistor.

    In the first case, you set the I/O pin HIGH to turn on the lamp. In the second case, you set the I/O pin LOW to turn on the lamp.

    Post Edited (Mike Green) : 6/6/2008 8:35:44 PM GMT
  • zoerrorzoerror Posts: 7
    edited 2008-06-06 20:33
    the buttons im refering to are the buttong on a guitar hero guitar. the green buttong and the blue buttong share the same ground. so when im playing a song, they both hit at the same time. i need to know how to stop that. i have tried various combinations with the three wires, but im dont know what im doing wrong. i have made it so they both stay pressed, i hvae made it where they both will hit at the same time, but i cant figure out how to make it to where only one is pressed without the other one beeing pressed as well.
    maybe its my code or something? im just trying to use somthing simple like this:
    high 15
    pause 250
    low 15

    i put the ground for both of them on the ground for 15. G represents the hot wire for the green button
    15 [noparse][[/noparse]-] [noparse][[/noparse]G] [noparse][[/noparse] ]
    14 [noparse][[/noparse] ] [noparse][[/noparse] ] [noparse][[/noparse] ]
    13 [noparse][[/noparse] ] [noparse][[/noparse] ] [noparse][[/noparse] ]
    12 [noparse][[/noparse] ] [noparse][[/noparse] ] [noparse][[/noparse] ]
    11 [noparse][[/noparse] ] [noparse][[/noparse] ] [noparse][[/noparse] ]

    now where do i put the Blue hot wire? i have tried putting it next the the Green hot but they both will hit at the same time. i have tried connecting the 15 pin with the 14 pin making the share the same ground, and having the blue hot wire under the green hot wire. i cant figure it out.

    i put:

    high 15
    pause 250
    low 15


    i also tried this with them sharing the same ground on 15 and 14:
    high 15
    low 14
    pause 250
    low 15

    but i cant figure this out....
  • FranklinFranklin Posts: 4,747
    edited 2008-06-06 20:43
    The ground should NOT go to a pin but the GROUND of the chip or the negative I can never remember what it's called but I think its VSS. Use a resistor in series to be safe!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • FranklinFranklin Posts: 4,747
    edited 2008-06-07 14:44
    Also you need to go and remove your duplicate post. Don't double post just because your not understanding the answers doesn't mean asking the question again will get you better help. You can edit the subject line here if you think it needs to be clearer.

    Have you tried my suggestion yet?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-06-07 15:47
    Duplicate post has been removed. Please follow up in the original thread. Duplicate/Cross posting is not allowed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • zoerrorzoerror Posts: 7
    edited 2008-06-08 03:56
    I hope this better explains my question. This is a link to a picture i even drew to help you better understand what im asking.

    http://img2.freeimagehosting.net/image.php?cb4a3da26a.jpg

    If you take a look at my picutre it helps me explain this a lot better, and youll get a better understanding of what im trying to ask. I have three buttons on a circuit board. buttons 1 and 2 share the same ground, and i cannot seperate this from which reasons i cannot explain. But they have two different positive wires. Now button 3 has its own ground and its own positive wire. I can take the ground wire from button 3 and place it in P15, and then take the positive wire and place it next to it and write a simple script like this.
    High 15
    Pause 250
    Low 15
    And that will activate buttons three.
    But for button 1 and button two im not sure how to hook them up. I have tried various things with them but everytime i try, i cant get one to activate without the other one activating as well. How can i prevent this? I need to know how to wire this so i can activate button 1 without button 2 activating as well, and vise versa
  • FranklinFranklin Posts: 4,747
    edited 2008-06-08 04:03
    Have you tried my suggestion yet?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-08 04:35
    You still have not made clear what these "buttons" do. I ask because, if they are pushbuttons, I don't understand why you're treating them like LEDs by connecting them to output pins (set with HIGH and LOW). If they're not pushbuttons, what are they?
  • zoerrorzoerror Posts: 7
    edited 2008-06-08 05:19
    the buttons represent the buttons on guitar for guitar hero. When they are pressed down, they are activated. When they are activated they represent me pressing them down to hit th notes on the screen. The green button and blue button share the same ground on the circuit board. Now the yellow and red button also share the same ground. the last button , "orange" has its own ground. i have no need for resistors, im just trying to make it possible to hit just the green key without have the blue key activate at the same time.

    Franklin: If you look at my pic, you would understand what im saying. I need to hook the ground into the basic stamp to complete the cricuit. I just when i do this, it complete the circuit for the green key "button one1" and the blue key "button 2". I need to know how to prevent this. I dont know how to make it any clearler what im trying to explain...
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-08 07:11
    You need to connect all the common leads to ground (Vss) and connect the other leads of the buttons through individual 4.7K resistors to +5V (Vdd). Connect the junction between the buttons and the 4.7K resistors each through a 220 Ohm resistor to a Stamp pin. You can detect a button being pressed with a "IF INx = 0 THEN" where "x" is the I/O pin you're using. Similarly, you can detect the button not being pressed with a "IF INx = 1 THEN".

    This description doesn't address what's called contact bounce. The BUTTON statement does that. Read the description in the PBasic manual.

    Do not use HIGH or LOW with these input pins. They're in input mode by default. Read about the INPUT statement if you want more info.
Sign In or Register to comment.