Any immediate help needed!!

Khubs

New Member
I am doing a project for my class that is due tuesday. I have been working with the PICAXE 08m all semester and I am trying to program my picaxe 28x1 and I can not do it. I am even trying a simple code like this.

main:
if pin2 = 1 then light
goto main

light:
high 7
pause 5000
low 7
goto main


and I have my output 7 wired to an LED.

When I turn on my PICAXE the light comes on completing ignoring the input pin 2. Am I doing something wrong I am missing. any input it insanely appreciated I have to finish this project and all I have left is programming which should be a pretty simple code.

Troubleshooting:

So far I know I can write code to my picaxe I dont think it is damaged.
 

Khubs

New Member
Also I know this sounds weird and no one will probably do it. But I am willing to give someone my number, or maybe do an IM just something so I can get immediate help I stress this because I am desperate. But if even at the least I get a reply I will be more than happy
 

goom

Senior Member
How have you wired the input to pin2? For a low input, it must be connected to 0v, not just left floating.
The code works in the simulator, so should work in real life.
 

Khubs

New Member
I have a wire from 5 volts that I attach to the pin acting as a switch ( kinda) is it supposed to be tied to 0v?
 

goom

Senior Member
Wire a 10K resistor from pin2 to 0V so that is is positively pulled low when the 5V input is disconnected. If you do not do this, when disconnecting the 5V the input will be floating, and the Picaxe will not know whether it is supposed to be high or low.
 

lbenson

Senior Member
>the Picaxe will not know whether it is supposed to be high or low

And if it thinks the non-pulled-down input pin is high, the LED will blink low so quickly that you won't see it. Put a pause 1000 after your LOW 7 so that you can see if it blinks off.
 

MartinM57

Moderator
The code is fine - but a pause 5000 after the low 7 would be better.

You have an electrical problem - without you showing us a circuit diagram we can't really help apart from telling you things that people normally get wrong.

Time is short, so you need to be methodical and quick at the same time.

Draw a circuit diagram and if it doesn't immediately show you what's wrong, post it here and we'll take a look (and make sure your wiring is EXACTLY (not kinda) consistent with the diagram you post)
 
Last edited:

westaust55

Moderator
And . . .

just to try and help move you along a little faster:

From PICAXE Manual 1 page 57 attached is how to wire a switch as an input to a PICAXE.

More examples in PICAXE Manual 3 page 25 (the 1kOhm resistor is not crucial in the diagrams here)
 

Attachments

Top