I think from the programme, leg 5 is used as an input to detect if LED 5 is on - it isn't detecting this condition correctly which is his problem.Starting with the hardware side of things,
Try modify the wiring from the PICAXE chip leg 5 which goes to the same side of R6 (150 Ohm) as the 4017 chip.
Instead go from the PICAXE chip leg 5 through another resistor and direct to the LED D6. See attached diagram.
As wired at the moment, PICAXE output 2 and the 4017 output are wired together directly. If the 4017 is low, even with the PICAE output high the LED will not light and there is every chance you can cause damage to the PICAXE chip since it will be like a short from PICAXE to 4017 under these conditions.
Also I suggest that you increase the resistance value of the resistors to the LED's to around 330 Ohms. They should still be bright enough.
I see what you mean. the code below will reset the 4017 after showing the level and reset the counter so they both start at 1 on changing levels.thats great will give it a try out on monday when i go back to school and hopefully we'll get it sorted out. Thanks, Ryan
b0=0
b11=1
w4=1000
Start:
Goto onsound
onsound:
Sound 4,(50,100)
Sound 4,(100,100)
Sound 4,(50,100)
goto mainprogram
mainprogram:
high 1
pause w4
low 1
b11=b11+1
if pin3=1 then hit
if b11=10 then resetcount
goto mainprogram
hit:
if b11=5 then winsound
goto nothitsound
return
nothitsound:
sound 4, (50,200)
goto start
resetcount:
b11=0
goto mainprogram
winsound:
sound 4,(126,100)
pause 100
goto Level
Level:
b0=b0+1 'level counter
w4=w4-95
High 0
Pause 25
Low 0 'resets 4017 to the beginning
For b1=0 to b0
High 1
Pause 25
Low 1
Next b1 'counter to level
Pause 5000
high 0 'after showing level sets 4017 back to 0 so LEDs and count are the same
pause 25
low 0
b11=1 'starts recounting from 1 after changing level
Goto mainprogram
finalsound:
sound 4, (70,100)
end
w4=1000
mainprogram:
High 1
pause w4
Low 1
if pin3 = 1 and pin2 = 1 then goto check
Goto mainprogram
check:
for b10=1 to 5
sound 4,(126,10)
pause 100
next b10
GOSUB flashybits ;delete afterwards
goto mainprogram
flashybits: ;Delete or keep?
for b0 = 1 to 100
high 1 : pause 50 : low 1
next
return
hi, the piezo is connected straight from pin4 of the picaxe and then to ground, i am using 3 AA batteries (4.5v), and there is no resistor connected?, do you think it may be the tune i am trying to play as it is an external tune i have downloaded off the picaxe software site.Do you have a link to the piezo?
Do you have any resistors/how have you connected it?
What voltage are you running off?
A
Some sounders are louder than others. An amplifier in series with the picaxe out put is really the answer or replace the sounder with a small loudspeaker and capacitor as in the interface manual - BUt you may not have room in your project caase for this.hi, the piezo is connected straight from pin4 of the picaxe and then to ground, i am using 3 AA batteries (4.5v), and there is no resistor connected?, do you think it may be the tune i am trying to play as it is an external tune i have downloaded off the picaxe software site.