Menu
JAQForum Ver 19.10.27

Forum Index : Microcontroller and PC projects : 8x8 Matrix LED Display Fun

   Page 3 of 3    
Posted: 09:40pm
07 May 2020
Copy link to clipboard
lizby
Guru

In that "For i = 1 To 6" loop, after the read, put "print i; " "; govenor(i)". I'm uncertain where the DATA settings are that the READ is acting upon.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Posted: 09:46pm
07 May 2020
Copy link to clipboard
Turbo46
Guru


Canada_Cold, The govener array is DIMed with a size of 6:

Dim chars(900), digi(8), clkcol(8,2), ASCIIptr(150,2), govenor(6)

And there are 6 numbers read into it:

For i = 1 To 6
Read govenor(i)
Next i
Data 19, 16, 12, 8, 4, 0

But dc (the index into it) can be set higher than 6:

dc = 0
For i = 1 To 8
If Mid$(msg$, i,1) <> Mid$(oldtime$,i,1) Then ' what digit changed?
digi(i) = 1
dc = dc + 1
Else
digi(i) = 0 'reset back to 0
Endif
Next i

I would change the DIM of govenor to 8:

Dim chars(900), digi(8), clkcol(8,2), ASCIIptr(150,2), govenor(8)

And add 2 more entries for its data:

For i = 1 To 8
Read govenor(i)
Next i
Data 19, 16, 12, 8, 4, 0, 0, 0


I think that should fix it.
Keep warm.

Bill
Keep safe. Live long and prosper.
 
Posted: 10:06pm
07 May 2020
Copy link to clipboard
TassyJim
Guru


A simple debug test would be to
PRINT dc
in a line before the error line.

Using OPTION BASE only sets the start of the array.
The maximum remains the same with OPTION BASE 1 and OPTION BASE 0

Jim
VK7JH
MMedit
 
Posted: 10:40pm
07 May 2020
Copy link to clipboard
Canada_Cold
Regular Member

Hi Bill (turbo46),

Thanks, That worked!  I’m not understanding why as yet, but that’s all part of the learning curve.

Have a great day, thanks, Don
 
Posted: 11:40pm
07 May 2020
Copy link to clipboard
Turbo46
Guru


An array is a collection of variables or data values. They must be of the same type: integer, floating point numbers or strings.

DIM govenor(6)

Creates an array with 6 different entries, govenor(1), govenor(2) through to govenor(6). They default to floating point numbers because the program does not specify otherwise (eg. AS INTEGER).

If you do not use the command:

OPTION BASE 1

there is also a govenor(0) entry which is often ignored – as it is in this program.

In the program a variable dc is used as an index into that array.

dc=1
PRINT govenor(dc)

will print the first entry in that array. The trouble is that dc is being set to values higher than 6 and so the programs is trying to read values in the array that do not exist and that is why you are getting the ‘index out of bounds’ error. I just suggested that you add two more elements to that array to avoid the error.

I hope that helps.

Bill
Keep safe. Live long and prosper.
 
Posted: 02:44am
08 May 2020
Copy link to clipboard
Justplayin
Guru


Okay, I setup a test rig and verified the code posted in this forum doesn't work.  The setup for the variable oldtime$ is missing spaces. I think the forum must have reformatted the variable.

In  MAIN change:
oldtime$ = " : : " 'non scrolling part of the clock display

to:
oldtime$ = "HH:MM:SS" 'non scrolling part of the clock display


The array size of 6 is correct since the maximum number of digits which can change is 6. Even though the time displayed can be up to 8 characters long, the colons will never change.

--Curtis
I am not a Mad Scientist...  It makes me happy inventing new ways to take over the world!!
 
Posted: 03:15am
08 May 2020
Copy link to clipboard
Turbo46
Guru


  Justplayin said  The array size of 6 is correct since the maximum number of digits which can change is 6. Even though the time displayed can be up to 8 characters long, the colons will never change.


In that case, the sub Show_Time must be changed. The variable dc can become greater than 6 and that is causing the 'index out of bounds' error.

Sub Show_Time
Local i, j, k, m, dc 'do not make k, m Local here
dc = 0
For i = 1 To 8
If Mid$(msg$, i,1) <> Mid$(oldtime$,i,1) Then ' what digit changed?
digi(i) = 1
dc = dc + 1
Else
digi(i) = 0 'reset back to 0
Endif
Next i


Great program. Thanks for sharing it.

Bill
Keep safe. Live long and prosper.
 
Posted: 04:03pm
10 May 2020
Copy link to clipboard
Canada_Cold
Regular Member

Hi All,

Thanks so much for all your input, I really appreciate all the debugging tips and the detailed explanation from Bill.  That's a great help for me in the understanding of the programming on the Mocromite.  

I agree, It's a great program, I have it working on a green dot-matrix display on my workbench and it is very cool, thanks again to Curtis for posting it.  

Don
 
Posted: 07:59am
08 Jun 2020
Copy link to clipboard
CaptainBoing
Guru


  Justplayin said  I have been playing around with some 8x8 matrix LEDs with MAX7219 driver boards and thought I would share some of the code.


Cheers Curtis.

I needed a clock for my workshop but I couldn't find anything I liked. Was bored yesterday and so I knocked up one on a mite using your code (and the proportional font!) as the basis. Have to say i got rid of the digit change animation... bit distracting.

Credited you in the boot here .

Big Thanks

h
 
Posted: 04:04am
09 Jun 2020
Copy link to clipboard
Justplayin
Guru


Glad to know you found the clock code useful and thanks for the boot credit.  

--Curtis
 
   Page 3 of 3    


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025