4x8 words moving across the screen

lake

New Member
hi i have an 8x8 matrix and i am using the last four rows so put some words going across the bottom of the screen iv done all of the code for the words and for the coulnms ive used var values so all i need to do is add or take one off the var to make the whole word move but the picaxe uses 0-7 in outputs and as soon as i get to let say 8 by adding one it comes up on the screen as 0 so it loops the outputs around does any one have any ideas on how to stop this or anyother way to do it thanks
 

hippy

Technical Support
Staff member
For people unfamiliar with exactly how your implementation is meant to work it's hard to visualise how you are doing this and therefore hard to say why it doesn't work or what needs to be changed.

The best approach for yourself is to look at what it should be doing, what you intended, and determine why it doesn't do what you expected. Once you know why it's going wrong you can prevent that and then make it do what it should be doing.

The best way to do this is to 'run your code on paper'. You act as the PICAXE with the paper showing variable values and outputs and see what happens when you execute each command. You can also use the simulator or put debugging commands in the actual code.

The key thing is to know what it should be doing when it's doing something else. Once you identify the discrepancy and why, you should be well on the way to fixing it.

Debugging is a fundamental part of programming, revealing design flaws and implementation errors, and it's as important learning how to do this as learning how to code. Some code works fine without debugging, other times there's a lot more debugging than coding.

Debugging requires having a good mental picture of what should be happening with an ability to match that to what is happening. It takes practice and some people are better at it than others.

From a different perspective there's the technique of asking how something could have gone wrong, "Why doesn't my variable increment to 256 ?" - In that case it could be because it's a byte variable with a maximum of 255, it's not being incremented, it is being incremented but by the wrong vale, it is having its value changed somewhere, a different variable is being incremented than the one being used, or the code never reaches where it should be reaching.

This is the 'crystal ball' factor, which lets people on this forum take educated guesses at what's gone wrong with a problem presented based on common mistakes made.

It's case of eliminating what could be going wrong which reveals the only other possible causes for a problem. Like 'twenty questions" / "Animal, Mineral, Vegetable ?", it's narrowing down what the error could be, even without seeing it. Prove something isn't the bug, then it must be one of the other causes.

It can be a long tortuous task at times, but it comes with the territory.
 

Tom2000

Senior Member
Hippy, it's a darned shame that this forum doesn't support "sticky" messages, or have its own resident FAQ.

Your posting constitutes "words to live by."

Since the forum doesn't support a way to journalize your very important post, maybe you should post it, in big, bold type, right on the head end of the Picaxe section of your page, so everyone visiting your page will see it, first thing.

Tom
 

Michael 2727

Senior Member
Arvin spent quite a lot of time developing a small application that will display moving characters on a 5x7 matrix from a picaxe <A href='http://www.rev-ed.co.uk/picaxe/forum/Topic.asp?topic_id=5465&amp;forum_id=28&amp;Topic_Title=POV%2Bone%2Bmore%2Btime&amp;forum_title=No+new+posts+please%21+20' Target=_Blank>External Web Link</a>
http://www.rev-ed.co.uk/picaxe/forum/Topic.asp?topic_id=5465&amp;forum_id=28&amp;Topic_Title=POV%2Bone%2Bmore%2Btime&amp;forum_title=No+new+posts+please%21+20
 
Top