Dear Flowcode Community,
I am experiencing an issue with storing and displaying custom characters on a 16x2 LCD using Flowcode. I attempted to use the RAMWrite function to store a character in index 1 and display it using PrintAscii(1), but the characters never appear.
Details of RAMWrite:
Modifies the internal memory of the LCD to allow for up to 8 custom characters to be created and stored in the device memory.
Parameters:
BYTE Index: Values from 0 to 7
BYTE d0 to BYTE d7
Return value: This function does not return a value.
Could you please provide a simplified example or a project file demonstrating how to correctly store and display custom characters using RAMWrite?
Thank you very much for your assistance!
Best regards,
Issue with Displaying Custom Characters on LCD
-
- Posts: 20
- http://meble-kuchenne.info.pl
- Joined: Sun Jan 14, 2024 10:15 am
- Has thanked: 5 times
- Been thanked: 2 times
-
- Matrix Staff
- Posts: 1952
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 510 times
- Been thanked: 698 times
Re: Issue with Displaying Custom Characters on LCD
Hello,
You first need to define your custom character. For example.
BYTE Index: 0
BYTE d0 to BYTE d7: 0xFF,0xAA,0x55,0x00,0xFF,0xAA,0x55,0x00
Change the d0-d7 bytes as required for your custom character.
Next use the PrintASCII function with a parameter of 0 to print your custom character. The custom character remains in RAM and you can print it as often as you like using the PrintASCII function.
Other custom characters are doen the same way but with index 1-7 instead of index 0.
You first need to define your custom character. For example.
BYTE Index: 0
BYTE d0 to BYTE d7: 0xFF,0xAA,0x55,0x00,0xFF,0xAA,0x55,0x00
Change the d0-d7 bytes as required for your custom character.
Next use the PrintASCII function with a parameter of 0 to print your custom character. The custom character remains in RAM and you can print it as often as you like using the PrintASCII function.
Other custom characters are doen the same way but with index 1-7 instead of index 0.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Re: Issue with Displaying Custom Characters on LCD
Hi Ben,
Thank you very much for your response and for explaining the steps to store and display custom characters. I followed the method you mentioned exactly, but unfortunately, it didn’t work for me.
I’ve attached the test file with this message for your review. When I ran the code, an error message appeared, but I couldn’t identify the cause. When I clicked on the error message, no error text was displayed.
I would appreciate it if you could help me figure out the issue and how to resolve it.
Thanks again for your continued support.
Best regards
Thank you very much for your response and for explaining the steps to store and display custom characters. I followed the method you mentioned exactly, but unfortunately, it didn’t work for me.
I’ve attached the test file with this message for your review. When I ran the code, an error message appeared, but I couldn’t identify the cause. When I clicked on the error message, no error text was displayed.
I would appreciate it if you could help me figure out the issue and how to resolve it.
Thanks again for your continued support.
Best regards
- Attachments
-
- Flowcode1.fcfx
- (10.18 KiB) Downloaded 189 times
-
- Matrix Staff
- Posts: 1952
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 510 times
- Been thanked: 698 times
Re: Issue with Displaying Custom Characters on LCD
Hello,
Looks like that should work ok. You don't need the RamWrite macro call inside the loop as you only need to specify your custom character once.
The custom characters may not simulate at the moment, I'll investigate this. but it should work ok on the hardware.
I didn't get an error so interested as to what that might be related to.
Have you tried on hardware at all?
Looks like that should work ok. You don't need the RamWrite macro call inside the loop as you only need to specify your custom character once.
The custom characters may not simulate at the moment, I'll investigate this. but it should work ok on the hardware.
I didn't get an error so interested as to what that might be related to.
Have you tried on hardware at all?
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Re: Issue with Displaying Custom Characters on LCD
Hi Ben,
Thank you for your advice and for clarifying the issue. I tested the code on the actual hardware, and I'm pleased to report that it worked perfectly!
It seems that the problem was indeed related to the simulation, as you mentioned. Removing the RAMWrite call from inside the loop also helped in improving the code.
I greatly appreciate your support and guidance. If I encounter any further issues in the future, I'll make sure to reach out to you. Thanks again for your help!
Best regards
Thank you for your advice and for clarifying the issue. I tested the code on the actual hardware, and I'm pleased to report that it worked perfectly!
It seems that the problem was indeed related to the simulation, as you mentioned. Removing the RAMWrite call from inside the loop also helped in improving the code.
I greatly appreciate your support and guidance. If I encounter any further issues in the future, I'll make sure to reach out to you. Thanks again for your help!
Best regards