push to make, or push to break?

Prototype

New Member
Hello,
I was wondering if anybody could help me with button high and lows...
I have got a chip that I have programmed that lights up my name in LED’s and has several modes using setint and an interrupt. To switch modes I am using a bog standard push to make SPST switch.

What I want to do is integrate my little circuit that flashes my name in LED’s into an old toy robot. I have already hooked power from the robots 4.5v supply to my 08m chip and I also want to use the robots small push to make button to cycle through the modes however its harder than I expected.
The small switch inside the robot has 3 legs. I have tested how the switch works by using a multimeter to measure voltage. Without the switch being closed there is a constant 4.5v running through it and when the switch is pressed there is no volts, this leads me to think that the switch is a push to break switch.

My current code is this:
Code:
do loop while Pin3 = 1
This does not seem right as pin 3 always equals 1 if the switch is a push to
make.

Could i get away with a code like this?
Code:
do loop while Pin3 = 0
Thank’s.


Prototype
 

BeanieBots

Moderator
Yes, you could use the alternative code with the other type of switch or you could wire it differently and use the same code.
You can have Vcc - switch - resistor - 0v or Vcc - resisitor - switch - 0v.
One will give the inverse function of the other which is the same as using your alternative code or push to make vs push to break.

Try it. Takes 5 seconds to reverse if it's the wrong around. Probably quicker than it took to post the question.
 

hippy

Ex-Staff (retired)
That should work. It will be worthwhile measuring all three pin contacts on the switch as it may be SPDT ( Single-Pole, Double-Throw ); a single contact switching connection between the other two contacts.
 

Prototype

New Member
No look so far, I’ll keep on trying though.

The weird thing is the multimeter reads 4.4 ish volts yet when a 3mm standard led is inserted to +v of the switch and 0v no light is emitted. Could this be because of ampage and if so what would be the correct setting to have my multimeter on to read amps?

can the input pin use a minute ampage from the switch?


Prototype
 

Technical

Technical Support
Staff member
We gues you are testing the switch by putting the red and black probes on two switch contacts, 4.5V when not pushed, 0V when pushed. This actaully makes it a normal push to make switch.

Unfortunately this doesn't help much with the rest of the circuit. Take the batteries out and put the black probe on the 0V connection of the battery position and measure the resistance (not voltage) to either side of the switch with the red probe. Do the same between 4.5V end of battery and both sides of the switch. Then let us have all the readings!
 
Last edited:

westaust55

Moderator
Suggest that you also look at the high side and low side switching diagrams in PICAXE manual 3 page 25 to make sure you have the connections and concepts correctly understood.

Maybe a circuit diagram would help as well, and even you more complete section of program code.
 

boriz

Senior Member
-“my little circuit that flashes my name in LED’s”

What circuit is that? How many LEDs? How does it flash?

-“Without the switch being closed there is a constant 4.5v running through it and when the switch is pressed there is no volts...”

With the limited information I have, I’d say it’s a push-to-make button.

-“4.5v running through it”

That’s a misnomer. Only current can run through a component. You have experience with electronics? You Know the difference between Voltage and Current? (I’m not judging. I’m trying to help.)
 

Dippy

Moderator
Have you got a resistor from the PICAXE pin to ground?
When a switch is opened the pin needs to be dragged down.
Suggest 22K from the PICAXE pin (connected to your switch) to ground.

Have a play with code... it's a darned site quicker than keeping asking ;)
 
Top