Star Trek Type 2 phaser power bar circuit

LED Maestro

Senior Member
Hello to all,
I am currently re-building a Star Trek type 2 phaser, if that means anything to anyone. I would like to know how to create a circuit that does the following: There are 16 LEDs in two rows of 8. I would like to cycle through them one after another with 2 button switches. ie press a button on the left and the first LED comes on. Press it again and the next LED comes on. Press it a third time and the third LED comes on. and so on. At his point there should be 3 LEDs on. Then, press the right button and that third LED goes off. Press again and the second goes off and so on. I was thinking of using a picaxe 20x2 but this is my first venture into picaxe.
Hope this isn't to long winded. Below is the link to a vid of what I am trying, not very well, to describe.

http://www.youtube.com/watch?v=BLYiVdC7Iv4

I would be grateful if anyone could help me out on this.
Thanks,
 

nick12ab

Senior Member
For your circuit, you'll need the appropriate LEDs - so normal bargraph ones if the gap between two side-by-side doesn't ruin the look or individual surface mount or 3mm LEDs divided by something opaque. The M2 and X2 parts are perfectly capable of multiplexing two rows of ten LEDs or four rows of five LEDs (12 and 9 pins required respectively). Plus two buttons and the one extra LED shown in the video. In this case, a 20X2 is perfectly capable of doing this.

P.S. Test things on breadboard before making a PCB!

Check out PICAXE Manual 1 for PICAXE Pinouts, and PICAXE Manual 2 for information on the different commands.
 

LED Maestro

Senior Member
Fantastic. Thanks for your help. I already have the LED's and most of the other components but now I know that the 20x2 chip will be ok, I shall go ahead and order some.
Thanks again,

P.S. I always use a breadboard now, after my last circuit design went horribly wrong on PCB.
 

nick12ab

Senior Member
Am I assuming that you also want to make the sound effects too? You might have to play around with them but you might need a seperate module for that.
 

eclectic

Moderator
A 28X2 could be used without any multiplexing.

Just for "playing" sake, in the simulator,
something like this as a starter

Code:
#picaxe 28X2
let dirsB= %1111111
Let dirsC = %1111111

main:

if pinA.0 = 1 then
high C.0
else low C.0
endif

if  pinA.1 = 1 then
high B.0
else low B.0
endif

if pinA.2 = 1 then
high B.2
else low B.2
endif

if pinA.3 = 1 then
high C.1
else low C.1
endif
goto main
and then progress from there.


e
 

LED Maestro

Senior Member
Hi Guys, Thanks for you replies, they're much appreciated. I would like to have sound at some point but to be honest my knowledge is limited to LED's, timers and IC's. This project is my first attempt at programing a micro-controller. Thanks for the code e. I will download the software from picaxe and have a play around.
I have to admit I am excited about this. To me, it's what electronics is all about. Trying something new and if it doesn't work, try a slightly different way.
Thanks again
 

LED Maestro

Senior Member
Hello again. I have played around a bit and came up with this code. If it's not to much problem, could you let me know where I can make improvements please. I had a bit of trouble using just two inputs, like the pushbutton switches, but as this is my first time writing code I am sure I have made mistakes.

Code:
main:	pause 2000
pause 500 if pinC.0 = 1 then add
pause 500 if pinc.0 = 1 then add2
pause 500 if pinc.0 = 1 then add3
pause 500 if pinC.0 = 1 then add4
pause 500 if pinC.0 = 1 then add5
pause 500 if pinc.0 = 1 then add6
pause 500 if pinC.1 = 1 then add7
pause 500 if pinC.1 = 1 then add8
pause 500 if pinC.1 = 1 then add9
pause 500 if pinC.1 = 1 then add10
pause 500 if pinC.1 = 1 then add11
pause 500 if pinC.1 = 1 then add12
	goto main

add:	pause 100 
	high B.1
	goto main
	
add2: pause 100
	high B.2
	goto main
	
add3: pause 100
	high B.3
	goto main 
	
add4: pause 100
	high B.4
	goto main 
	
add5: pause 100
	high B.5
	goto main 
	
add6: pause 100
	high B.6
	goto main 
	
add7: pause 100
	low B.6
	goto main 
	
add8: pause 100
	low B.5
	goto main 
	
add9: pause 100
	low B.4
	goto main 
	
add10: pause 100
	low B.3
	goto main 
	
add11: pause 100
	low B.2
	goto main 
	
add12: pause 100
	low B.1
	goto main
Look forward to suggestions
 
Top