I am trying to use Generic MAX7219 8x8 Dot Matrix module with GCB and Arduino Nano 328P. After using the example file, the following are the observations.
Display is 90 degree rotated with reference to IC.
The message starts on the farthest module from Arduino Nano.
YouTube video link is here https://youtu.be/9t5RB3dxJD4
Any solution to this issue or any guidance how to change the library files to adopt this module?
Thanks and regards,
Awais
Last edit: Awais 2018-11-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As a test, as I have NOT tested. Do exactly the following:
Add the is code unchanged to your program.
If this works then I can explain later.
#define Max7219_LEDMatrix_ScrollMessage Max7219_LEDMatrix_ScrollMessageOut
Sub Max7219_LEDMatrix_ScrollMessageOut( in OutMessage as string, In max7219_MessageTime As Word )
dim max7219_ScrollLen, max7219_ScrollPosition, max7219_XScrollPosition as word
max7219_ScrollLen = OutMessage(0) * GLCDFontWidth
max7219_XScrollPosition = 0'Max7219_PixelBytes-1
For max7219_ScrollPosition = 0 to max7219_ScrollLen-1
Max7219_LEDMatrix_ClearBuffer ( Max7219_Image_Buffer() ,Max7219_PixelBytes)
GLCDPrint(max7219_XScrollPosition, 0, OutMessage)
max7219_XScrollPosition++
Max7219_LEDMatrix_SendBuffer ( Max7219_Image_Buffer() ,Max7219_PixelBytes)
if max7219_MessageTime > 0 then
Wait max7219_MessageTime ms
end if
Next
End Sub
Last edit: Anobium 2018-11-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have posted a revised method. This shows the basic left to right scroll. My first attempt failed. :-(
The original library was based on a right to left scroll that is used on the UK train system. :-)
To understand. Think of the matrix as a set of pixel, they are stored in memory. The pixels are updated using the GLCD command set. Then, the methods set the memory to the display.
You should be able to change the library to do a lot more than I have in the library.
Anobium
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, the message should scroll from right to left but I am surprised that why it is from left to right in my hardware (right one is the first module which is connected to Arduino). I tested Parola library for Arduino and its ok but there are issues of consistency. But with GCB its good. The system is running fine. Now, the orientation and scrolling direction have to be controlled. I will try to understand the routines to tune it for the requirements.
Please update here if you come up with the solution.
Thanks and regards,
Awais
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As this is using the GLCD command set - you are using the GLCD fonts.
I posted a demo how to do this. See you installation - ..\Demos\GLCD_Solutions\GLCD_Demonstration_of_adding_additional_Font_Solutions\GLCD_Adding_an_second_Font_16F886_for_KS0108@16.gcb
The method is the same - essentially replace GLCDDrawChar with your routine and your tables - then you can edit away to your hearts content. :-)
Leave glcd.h and the other .h files as is... use the method shown in the demo. It is SO easy to loose adapted .h files and using the method shown in the demo ensure your do not loose your good works.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Regarding the degree "°" sign. I would not change the font. Simply pset the character out. So, pset the character out at the appropiate location using a table of the bits.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I suppose the font table used has a start address so 8 bytes per char, find start of char to change and design on paper and each pixel in a row is a bit.
I'm guessing. I looked at glcd and #ifdef GLCD_OLED_FONT
CharCode = CharCode - 16
ReadTable OLEDFont1Index, CharCode, LocalCharCode
ReadTable OLEDFont1Data, LocalCharCode , COLSperfont
I would want to change all the chars to user designed graphics, there's plenty of program memory and ram to read a table into ram.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
GLCD_OLED_FONT = 1 this reads the tables called OLEDFont1Index and OLEDFont1Data. Replacing this is one way.
The real way - and the one that want to do is here: http://oleddisplay.squix.ch/#/home There is NOT reason why a simple converter could not read this font table and use the define fontset. With a simple converter any font could be used with this utility.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Since I have a few displays that have gcb support I should have already tried udgs but...etc.
I last changed a charset on a sinclair or amstrad but I suppose it's the same idea.
The char set was in rom but there was an address you could change to point to ram so you designed another char set in ram. So print "a" would print the "a" in ram.
Is this the basic idea using gcb. Ie the char set is stored somewhere and the start is known, each char is 8 rows of 1 byte and each byte represents 8 pixels/leds?
Is connecting two displays to use as a 16x32 possible with gcb...or any system?
Cheers.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to use Generic MAX7219 8x8 Dot Matrix module with GCB and Arduino Nano 328P. After using the example file, the following are the observations.
YouTube video link is here https://youtu.be/9t5RB3dxJD4
Any solution to this issue or any guidance how to change the library files to adopt this module?
Thanks and regards,
Awais
Last edit: Awais 2018-11-27
Hello
When I wrote the library, I guessed but did not know, that these Matrixes would be upside down.
Add this to your user program. This should rotate the matrix.
#define Pset max7219_LEDMatrix_PSet_90Once we have the matrix the correct way around we can adapt for write direction.
Thank you. Now, text is scrolling correctly. But in my hardware design the text should be upside down. So, the command should be something similar to
define Pset max7219_LEDMatrix_PSet_270
and the first module connected to Nano is the first from right hand side. So, text scrolling should be from right to left.
YouTube video link is here https://youtu.be/A6L7K7WLLnU
Last edit: Awais 2018-11-27
I am being dim? but, just rotate the matrix... or, am I missing something?
You are right. That is one solution but there are other concerns due to which I cannot rotate it.
As a test, as I have NOT tested. Do exactly the following:
Add the is code unchanged to your program.
If this works then I can explain later.
Last edit: Anobium 2018-11-27
I have posted a revised method. This shows the basic left to right scroll. My first attempt failed. :-(
The original library was based on a right to left scroll that is used on the UK train system. :-)
To understand. Think of the matrix as a set of pixel, they are stored in memory. The pixels are updated using the GLCD command set. Then, the methods set the memory to the display.
You should be able to change the library to do a lot more than I have in the library.
Anobium
Yes, the message should scroll from right to left but I am surprised that why it is from left to right in my hardware (right one is the first module which is connected to Arduino). I tested Parola library for Arduino and its ok but there are issues of consistency. But with GCB its good. The system is running fine. Now, the orientation and scrolling direction have to be controlled. I will try to understand the routines to tune it for the requirements.
Please update here if you come up with the solution.
Thanks and regards,
Awais
I would look at PSET. The PSET updates the internal memory array, the other routines then send the memory array to the matrixes.
The matrixes are so differernt. I have learnt this recently. Some are left to right, up and down and other dont work.
So, look at PSET - this updates memory array then adapt the routines that update the devices... with respect to direction. Sounds so easy.
Demo video using GCB, Arduino Nano, Dot Matrix Display with MAX7219, DS3231 and DHT22
https://www.youtube.com/watch?v=yEiVToSmaUA
Very nice!
Post the project code! Lots of folks are interested.
Thanks for your comments. Here is the code. Please add this to demo codes in next release of GCB.
Waiting for some more twists from the coding fellows.
With kind regards,
Awais
What a good idea!
See https://github.com/Anobium/Great-Cow-BASIC-Demonstration-Sources/tree/master/LED_Matrix_Solutions/Completed_working_projects
Once again, thank you for your prompt consideration.
One question, how can I edit the fonts or you can say alter the alphabets?
Pleasure, good to see someone using the software.
As this is using the GLCD command set - you are using the GLCD fonts.
I posted a demo how to do this. See you installation - ..\Demos\GLCD_Solutions\GLCD_Demonstration_of_adding_additional_Font_Solutions\GLCD_Adding_an_second_Font_16F886_for_KS0108@16.gcb
The method is the same - essentially replace GLCDDrawChar with your routine and your tables - then you can edit away to your hearts content. :-)
Leave glcd.h and the other .h files as is... use the method shown in the demo. It is SO easy to loose adapted .h files and using the method shown in the demo ensure your do not loose your good works.
Thanks. I will check.
I ordered 2 .... https://www.ebay.co.uk/itm/MAX7219-Microcontroller-4-In-One-Display-Module-For-Arduino-5P-Line-Dot-Matrix/292804189269?epid=1994378909&hash=item442c7d5c55:g:jEcAAOSwIGxb4A~W:rk:11:pf:0
As said ..they're not all the same but will see.
Thanks for doing the hard work. I use arduino more than pic so useful code.
Maybe one day ebay will say "works with gcband arduino", as more hardware is included.
I orderded 2 to see if a 16x32 dot addressable display was possible.
You are welcome. Now, I want to put degree "°" sign with C or F as per preference, e.g. 25°C 75%. Will anyone come with the solution?
Check aliexpress.com also https://www.aliexpress.com/wholesale?spm=2114.search0104.8.32.2e736d36jK7b9r&initiative_id=QRW_20181207234535&SearchText=max7219+display+module&productId=32880754577
Sometimes cheaper than ebay and "Buyer Protection" https://sale.aliexpress.com/__pc/BhQPgEWPNM.htm?spm=2114.search0104.7.1.1d97718c1vfVRh
I didn't search the entire forum. Just found this utility "8x8 Pixel ROM Font Editor".
https://www.min.at/prinz/o/software/pixelfont/
Regarding the degree "°" sign. I would not change the font. Simply pset the character out. So, pset the character out at the appropiate location using a table of the bits.
I did the following changes.
And it's working.
Thanks and regards,
Awais
I suppose the font table used has a start address so 8 bytes per char, find start of char to change and design on paper and each pixel in a row is a bit.
I'm guessing. I looked at glcd and #ifdef GLCD_OLED_FONT
CharCode = CharCode - 16
ReadTable OLEDFont1Index, CharCode, LocalCharCode
ReadTable OLEDFont1Data, LocalCharCode , COLSperfont
I would want to change all the chars to user designed graphics, there's plenty of program memory and ram to read a table into ram.
That is not way I would do it. As I am not guess.
GLCD_OLED_FONT = 1 this reads the tables called OLEDFont1Index and OLEDFont1Data. Replacing this is one way.
The real way - and the one that want to do is here: http://oleddisplay.squix.ch/#/home There is NOT reason why a simple converter could not read this font table and use the define fontset. With a simple converter any font could be used with this utility.
Since I have a few displays that have gcb support I should have already tried udgs but...etc.
I last changed a charset on a sinclair or amstrad but I suppose it's the same idea.
The char set was in rom but there was an address you could change to point to ram so you designed another char set in ram. So print "a" would print the "a" in ram.
Is this the basic idea using gcb. Ie the char set is stored somewhere and the start is known, each char is 8 rows of 1 byte and each byte represents 8 pixels/leds?
Is connecting two displays to use as a 16x32 possible with gcb...or any system?
Cheers.