steve24rdg
Member
Hello
I am trying to learn a few things and I hope someone can help me.
I am doing the seven segment display experiment form the 3rd section of the picaxe manual on page 22. using the 4026b decade counter.
I managed to do it for 1, 2 and 3 numbers (changing the bit variables to word variables to enable the count upto 999).
Then I thought I would try to control and vary the number by using a potentiometer, that worked too.
I can get 0 - 255, (which i expected) but i want to change the range displayed from 0 to 999, or any other range that I might choose.
The problem is I have no idea how to do this. I am sure it must be possible but I cant work it out.
Can someone help me please?
Here is my code, mostly copied from the manual. I am using the 40x2 chip
adcsetup = 0
main: let w1 =w2
readadc a.0, w2
gosub clock
pause 1000
goto main
clock: pulsout c.1,10
if w1 = 0 then endclk
for w3 = 1 to w1
pulsout c.0, 10
next w3
endclk: return
Also is there any other way I can make the count faster? for 2 digits it is ok but 3 is quite slow.
I tried using pwmout to replace pulsout, ant it did work with varying degrees of sucsess, but I was getting from 0 - 732ish on the display for some reason.
My plan is to replace the potentiometer with a sensor to detect rotational speed, or maybe just position.
I have a fairchild qrb1134 IR emitting diode and phototransistor in my box so I wanted to use that.
thanks in advance
Steve
I am trying to learn a few things and I hope someone can help me.
I am doing the seven segment display experiment form the 3rd section of the picaxe manual on page 22. using the 4026b decade counter.
I managed to do it for 1, 2 and 3 numbers (changing the bit variables to word variables to enable the count upto 999).
Then I thought I would try to control and vary the number by using a potentiometer, that worked too.
I can get 0 - 255, (which i expected) but i want to change the range displayed from 0 to 999, or any other range that I might choose.
The problem is I have no idea how to do this. I am sure it must be possible but I cant work it out.
Can someone help me please?
Here is my code, mostly copied from the manual. I am using the 40x2 chip
adcsetup = 0
main: let w1 =w2
readadc a.0, w2
gosub clock
pause 1000
goto main
clock: pulsout c.1,10
if w1 = 0 then endclk
for w3 = 1 to w1
pulsout c.0, 10
next w3
endclk: return
Also is there any other way I can make the count faster? for 2 digits it is ok but 3 is quite slow.
I tried using pwmout to replace pulsout, ant it did work with varying degrees of sucsess, but I was getting from 0 - 732ish on the display for some reason.
My plan is to replace the potentiometer with a sensor to detect rotational speed, or maybe just position.
I have a fairchild qrb1134 IR emitting diode and phototransistor in my box so I wanted to use that.
thanks in advance
Steve