linking two dot matrix

lake

New Member
hi, i am planning on making a dot matrix pong game(two paddles and a ball which you batt around) testing my game using the simlation i have just seen that it is very easy due to it being almost square 7x8 matrix so i thought maybe i could hook up two matrix using all of the same code (apart from one of the paddles) and use another picaxe to monitor the center (2 of the the first and last row of each matrix )rows and columns on my dotmatrix this would use all 16 off the inputs 7 verticle and 1 for the column on each dot matrix and use that picaxe to see if any of the led are on and then send a output to the other domatrix which will continue the ball moving across the sceen and depending on which verticle led it is on hold the output on or that amout of pauses to tell the dotmatrix where to start the ball

crazy idea just wondering if it was possible maybe for a future project
thanks


i might need 2picxe to monitor the dotmatrixs as i will need to see two columns to see if the ball is moving up or down aswell as across
 

hippy

Technical Support
Staff member
To simplify things, it's easier not to monitor the actual dot matrix, but have one PICAXE do all the processing and control half the matrix, then send the information to the other to tell it what to put on its display.
 

Mike7081

New Member
To save some outputs I used a 74LS138 3-to-8 decoder IC. You only need 3 outputs to select each of the 8 columns and 7 outputs for the rows.
 

lake

New Member
thanks for post everyone

ill just look into that chip that you just told me about thanks.

axeeffect if you only used 3 ouputs coudnt you have a lot bigger one off one picaxe?


ive been looking for that chip but nothing but junk really do you hae any pdf on it or just tell me how it works briefly thanks

Edited by - lakey009 on 26/06/2007 17:12:10
 

lake

New Member
hippy i am using picaxe 28x well hoping they have 16 outputs in total and i have a 7x8 matrix so 15 outputs
so i would only have one output to connect to the other picaxe so one output to tell the other picaxe where the ball is.

is that possible i think it could be?

i might have to do it in really fast short pauses linking to other gosubs or is there a better way to go about it
 

hippy

Technical Support
Staff member
One line is all that's needed to send serial data and you have Serial Out ( SERTXD ) as well.

You need to design a system architecture which splits functionality - A ball handler which determines where the ball is and has moved to, paddle handlers which determine where the paddles are, and from that you will have a set of data which would allow you to draw the required display(s). That code would be same ( with different playing area limits ) no matter what size display you had, be it 7x8 or 70x80.

Once you have that 'position of objects' data, separate parts of the program will set the displays as appropriate or tell other PICAXE's to set their display as appropriate, all of which can be done simply knowing object positions.

Your previous example code had the display drawing tightly integrated with the object moving and you need to break the two distinct fuctional parts apart.

You need to go from ...<code><pre><font size=2 face='Courier'> Input ---&gt; Process &amp; Output </font></pre></code> to<code><pre><font size=2 face='Courier'>
Input ---&gt; Process ---&gt; Position Data ---&gt; Output </font></pre></code> then moving to<code><pre><font size=2 face='Courier'>Input ---&gt; Process ---&gt; Position Data -.-&gt; Output
|
Pass-On
|
`-&gt; Output </font></pre></code> becomes an awful lot easier.

In technical terms, your earlier System Architecture is, &quot;shot to buggery&quot;. It works, but isn't what's called 'scalable'; that means it gets harder and harder to make changes as you add more to it or want to expand its capabilities. Do it right and you can add not just another PICAXE plus 7x8 but however many you'd like, and all with minimal effort.

There's nothing wrong with how you've started, and well done for achieving so much. As complexity increases though there are certain techniques discovered over the years which make things a lot easier to deal with.

You've reached one of those points where you tear up the current project ( but keep the knowledge you've gained ), and move on to doing it again in a way which is simpler, and easier to scale. When you've done that you'll look back and see how much simpler it is.

I've got to go out now ( see, I do have a life away from the Forum ! ) but I'll add some more on how it may be best to move forward. You've done really well so far, but I'd hate to see you go up a blind alley and waste a lot of effort or lose enthusiasm.
 

erdc

Member
Here is the pdf explaining how to use the chip <A href='http://pdfserv.maxim-ic.com/en/an/AN1033.pdf' Target=_Blank>External Web Link</a>

And here is the data sheet for it <A href='http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3291[a/] ' Target=_Blank>External Web Link</a>
 

lake

New Member
thanks alot i coulnt find anything like this it will help loads hippy thanks for advise im just been moving all of my code around and it is already alot smaller and easyer to see what it does but i have a lot of programming that i now could be smaller ill post it up and can someone give me tips on how to get it smaller thanks alot everyone

Edited by - lakey009 on 27/06/2007 20:14:25
 

lake

New Member
symbol b6 and b7 is the output in number form as i saw it and it looked easy to use and i got both the paddles to 17lines
b1 i the postion of the balls up and down i need to change all my code and put symbols in i will soon


checkrightpad:
if b6=28 and b1=3 then middlebounce
if b6=112 and b1=5 then middlebounce
if b6=56 and b1=4 then middlebounce
if b6=14 and b1=2 then middlebounce
if b6=7 and b1=1 then middlebounce
if b6=28 and b1=4 then topbounce
if b6=112 and b1=6 then topbounce
if b6=56 and b1=5 then topbounce
if b6=14 and b1=3 then topbounce
if b6=7 and b1=2 then topbounce
if b6=28 and b1=2 then bottombounce
if b6=112 and b1=4 then bottombounce
if b6=56 and b1=3 then bottombounce
if b6=14 and b1=1 then bottombounce
if b6=7 and b1=0 then bottombounce
goto player1
checkleftpad:
if b7=28 and b1=3 then middlebounce2
if b7=112 and b1=5 then middlebounce2
if b7=56 and b1=4 then middlebounce2
if b7=14 and b1=2 then middlebounce2
if b7=7 and b1=1 then middlebounce2
if b7=28 and b1=4 then topbounce2
if b7=112 and b1=6 then topbounce2
if b7=56 and b1=5 then topbounce2
if b7=14 and b1=3 then topbounce2
if b7=7 and b1=2 then topbounce2
if b7=28 and b1=2 then bottombounce2
if b7=112 and b1=4 then bottombounce2
if b7=56 and b1=3 then bottombounce2
if b7=14 and b1=1 then bottombounce2
if b7=7 and b1=0 then bottombounce2
goto player2

b2 is the value that is added on to move the ball left and right
b0 is the value of of ball left to right so 6 is touching the paddle and 1 is also but the other paddle
b4 is the value which is added on to move the ball up or down the side of the dot matrix
and the sound is just the hit i need to change this as it will be on so fast you might not hear it



middlebounce:
sound 7,(30,1)
let b2=-1
let b0=6
goto ball2

middlebounce2:
sound 7,(30,1)
let b2=1
let b0=1
goto ball2

topbounce:
sound 7,(30,1)
let b4=1
let b2=-1
let b0=6
goto ball2

topbounce2:
sound 7,(30,1)
let b4=1
let b2=1
let b0=1
goto ball2

bottombounce:
sound 7,(30,1)
let b4=-1
let b2=-1
let b0=6
goto ball2

bottombounce2:
sound 7,(30,1)
let b4=-1
let b2=1
let b0=1
goto ball2
 
Top