Funny behaviour in a picaxe

Hi all, I hope people can help with this, cos I'm baffled.

I've been using a picaxe 08M2 (the new one) to control a stepper motor, which works fine until I want to use the free input to trigger the motor.

When I do that no input affects what the chip is doing

I took it back to the program, nothing odd there, so I tried using a pushbutton switch to turn an LED on and off.

If I use this program:

main:

if pinC.3 = 1 then

high 1

else

low 1

endif

goto main

Then when the pin should be low it just flickers on constantly, then goes steady if I push the button.

If I do it the other way so that the button turns it off, it flickers when it should be on, then goes off if I push the button...

Please assist! And ask for clarification if anything's not clear.

Mike

Resistor

Sounds like you could use a pull-up or pull-down resistor on your pushbutton to keep the pin from floating when the button is not pushed.

floating

you should at a delay somewhere as that piece of code is running over and over very quickly.

oops I read It too quickly. indeed it’s floating. does a picaxe have intern pullup resistors?


Aha yes! Thanks, I’ll try it

Aha yes! Thanks, I’ll try it :smiley: but tomorrow, sleepytime now ¦¬0

I never remember that picaxes don’t have internal pull-ups (at least i think I never remember…)