Please help, how can I use Arduino nano+GC9A01 to create a UI display interface? - Page 1
Forum section: electronics / projects

author: daisizhou
author_rank: Super Contributor
timestamp: December 15, 2023, 02:29:51 am
content: Hallo everyoneI plan to make an instrument panel,It is a nano motherboard+GC9A01 display screen.I hope the UI interface of the dashboard is shown in the following figure,Is this combination acceptable? If possible, how can I create this UI interface? I am a novice programmer,I don't know how to create this UI interface and how to program it correctlyMy Plan IntroductionI plan to make an oil reminder device in my spare time,It is installed inside the motorcycle dashboard,Obtaining signals from traditional mechanical odometers.Further description,Using Arduino nano as motherboard,GC9A01 is used for displaying,The IR module is used to obtain data from traditional odometers,DS3231 is used for time display and time storage after power off,Two buttons, one for time setting and adjustment, and the other for oil reset and one-way odometer resetThe oil life display is from 0 kilometers to 2000 kilometersThe 0 kilometer position is displayed in green, while the red display shows 1500-2000 kilometers..Infrared sensor 140 pulses (mechanical turntable, 140 turns), odometer displays 1000 metersThe one-way mileage display and oil display share the same button, which is KEY2,A single trigger of KEY2 can reset the one-way mileage display to zero, and holding down the KEY2 button for a long time can reset the oil display to zero,The mileage data and oil data are saved to NANO's EEPROM, which can be automatically stored after turning off the power and read from the EEPROM after the second startupKEY1 button for digital clock adjustment,Press and hold KEY1 for a long time to activate the time adjustment program, and the digital clock will flash,Intermittently pressing KEY1 is used to adjust the minute setting, and the time display format is in a 12 hour format for easy adjustment,Automatically save settings after successful setup

author: coromonadalix
author_rank: Super Contributor
timestamp: December 15, 2023, 03:10:11 am
content: why restarting a thread about this display and not continue the other, you have been helped there a lotyou want the others to do your job ?https://www.eevblog.com/forum/projects/help-nano-how-to-drive-gc9a01-lcd-display/

author: daisizhou
author_rank: Super Contributor
timestamp: December 15, 2023, 03:30:06 am
content: Thanks。In that thread, I attempted to use "Adafruit_GC9A01A" to drive GC9A01.I successfully drove GC9A01.But I don't know how to create a UI interface.There are many examples of dot matrix LCD screen production on the Internet, such as 1602 or 2002,And using GC9A01 is using ESP32 microcontroller.There are very few plans made using Arduino NANO+GC9A01 alone.There is almost no UI interface like what I hope for.So I hope my friends here can help me,Thank you.

author: daisizhou
author_rank: Super Contributor
timestamp: December 15, 2023, 03:44:23 am
content: I tried to code it myself but unfortunately I failed.I watched the following video tutorialThese are all written using 1602 or ESP32,I tried to copy the ESP32 code and run it inside NANO's programming IDE, but it didn't work.I checked GOOGLE and someone suggested usingSquareLine Studio (LVGL) interactive compilation, but I don’t know how to use SquareLine Studio.So I can only post for help again, hoping someone can help me

author: tooki
author_rank: Super Contributor
timestamp: December 15, 2023, 10:31:52 am
content: Quote from: daisizhou on December 15, 2023, 03:30:06 amMaking pretty GUIs can easily exceed the memory of an Atmega328 chip, like used in Arduino uno and nano. Since an ESP32 costs the same and has hundreds of times the resources (memory, storage, CPU power) and WiFi and Bluetooth, that’s why you see the ESP32 used for that type of project. (Or raspberry pi pico, or some STM32. Either way, something way more powerful.)Also, drawing color images to the screen over a serial interface (like SPI) can be slow, so a faster MCU with a faster bus speed (like on ESP32 and the others I listed) means much faster screen updates.

author: daisizhou
author_rank: Super Contributor
timestamp: December 15, 2023, 11:02:45 am
content: Thanks.I've considered what you said,I prepared a 25Q64F chip,If the memory cannot be stored, my plan is to store it inside the 25Q64F chip.If my plan is still defective, I will replace the NANO motherboard with an ESP32 motherboard, because the ESP32 motherboard still needs to be purchased and takes time to ship.All I have on hand is a ready-made NANO motherboard and 25Q64F flash memory chip.

author: tooki
author_rank: Super Contributor
timestamp: December 15, 2023, 12:39:20 pm
content: When I mentioned “memory” and “storage”, I meant the typical meaning of “RAM” vs “storage”. Flash is storage, not RAM. You can store images and other data in flash memory, but you can’t use it for code execution and buffering.The Atmega328 has 2KB of RAM. That’s it. A single frame buffer for 24-bit color (3 bytes per pixel) for that 240x240 display is 169KB, so you couldn’t even begin to just single-buffer your display. External flash can’t help here.The display driver may have its own buffers you can use, so maybe that can work. But I think the Atmega328 is not the right tool for this job. Even without memory limitations, it’s a slow MCU.

author: daisizhou
author_rank: Super Contributor
timestamp: December 15, 2023, 01:12:10 pm
content: Is it okay for me to choose a motherboard like ESP32-C3?Because ESP32 has too many hardware versions, I don't know how to chooseESP-C3 has 4MB flash and 2.4G wifi and Bluetooth,The information describes its built-in RTC function,So is my DS3231 extra?Also, if I choose ESP32, can I add the attached image as the startup logo?I am a beginner in microcontrollers and I am not good at using programming tools. I only know the Arduino IDE,And use the IDE for simple uploading and other operationsI chose the Arduino nano motherboard because it is in my inventory,ESP32 motherboard still needs to be purchased again

author: daisizhou
author_rank: Super Contributor
timestamp: December 15, 2023, 01:44:05 pm
content: please watch this video-->https://youtu.be/JPhrczZHI30This author successfully used NANO to create.The functionality I was hoping for looked very similar to hers

author: donlisms
author_rank: Frequent Contributor
timestamp: December 15, 2023, 02:26:30 pm
content: I think you need to learn. A lot. And nobody can do that for you.Don't start with this whole project - start with learning the basics. You should be able to write code that draws a circle. Then a ring. Then any color ring. Then a ring that starts and ends at some particular angles.By the time you can do that, you should be ready to start thinking about how to put your UI together.This is just my opinion. I don't think "easy" is always best, or is always possible, especially if you are hoping someone else can do the hard parts for you. But if you learn, which is hard, the project will be easy. It sounds like you need to become a good programmer before you can succeed with this project.

author: xrunner
author_rank: Super Contributor
timestamp: December 15, 2023, 02:27:48 pm
content: Quote from: daisizhou on December 15, 2023, 01:44:05 pmLook up the specs on Arduino Nano 33 ... it's not a basic Nano. Do more research on the parts is the first step.

author: tooki
author_rank: Super Contributor
timestamp: December 15, 2023, 02:36:52 pm
content: Quote from: daisizhou on December 15, 2023, 01:44:05 pmNot even close.1.That’s a “smart display” or “HMI module” (human-machine interface), meaning that the display contains its own processor, storage, and memory. The desktop program she used to lay out the GUI creates code that runs on the display. The display and Arduino simply send commands over UART. (In other words, in this case, the Arduino simply sends the speed to the display. The display does all of the graphics on its own. The Arduino knows nothing about the graphics.)This is the processor used in that display:https://resources.4dsystems.com.au/datasheets/pixxi28/home/You will notice that it does tons of things. So the Arduino doesn’t have to do any of that.2.That’s not an Arduino Nano. It’s an Arduino Nano 33, a completely different product with FAR more power than a regular Nano.

author: tooki
author_rank: Super Contributor
timestamp: December 15, 2023, 03:07:58 pm
content: Quote from: daisizhou on December 15, 2023, 01:12:10 pmIt’d be fine, but I’d probably recommend an ESP32 dev board with the ESP32-WROOM module on it. It’s the oldest ESP32, so the software support for it is the most mature.However, there is an ESP32-S3 board with built-in circular display:https://www.lilygo.cc/products/t-rgbThat’d be brilliant for your project.Quote from: daisizhou on December 15, 2023, 01:12:10 pmUse the DS3231 (a great choice). Using the ESP32’s built-in RTC requires hardware and software skills you don’t have, and is probably much harder to get as accurate as you want. The DS3231 is a brilliant part that makes it easy to get a super accurate clock.Quote from: daisizhou on December 15, 2023, 01:12:10 pmA startup logo is simply an image you display. When you show it is up to you.Quote from: daisizhou on December 15, 2023, 01:12:10 pmThat is obvious. Which is fine, we all started as beginners! But given that you’re a beginner, you may want to try to appear less argumentative.Quote from: daisizhou on December 15, 2023, 01:12:10 pmWell… yeah, that’s its purpose. Not sure what else you would be using it for!Quote from: daisizhou on December 15, 2023, 01:12:10 pmTrying to use what you have is great, but you also need to accept that different parts have different capabilities, and that what you have may not be suitable for any given project. (This is why a lot of us now recommend not stocking up on lots of parts, since we can now order what we need and get it quickly.)Strictly speaking, itispossible to do this project with the Nano you have. But you’ll be severely limited in the kinds of graphics you can draw, especially because you’re not an experienced enough programmer to create workarounds for the Nano’s limitations (for example, to read the logo from external flash little by little and draw it to the screen little by little).It’d make much more sense, in my opinion, to use a newer MCU with ample resources, so you can focus on learning how to integrate the different parts, rather than on hardcore memory optimization.

author: daisizhou
author_rank: Super Contributor
timestamp: December 16, 2023, 07:44:34 am
content: Thank you for your help.Based on the current hardware, I just want a simple time display and one-way mileage display, is that okay?I mean,Use the color GC9A01 screen as a simple displayIn other words, I hope to realize the function, but I give up the beautiful pictures and images. The hardware is still using nano+gc9a01+ds3231.

author: coromonadalix
author_rank: Super Contributor
timestamp: December 16, 2023, 02:07:57 pm
content: you ask for a lot of things, but your contributions .......... so far many of your threads are on the asking sidei'm not picking on you .... but your behaviour ...you received great help on your previous thread as i wrote, now its the time to apply thoses explications and learn and createyou did not understood the arduino platform and or the type of needed power to adress your requests, storing the images / backgrounds etc ... take place in the codeyou have many tutorials on the web ...you've been told about HMI products or self contained ones ...

author: daisizhou
author_rank: Super Contributor
timestamp: December 17, 2023, 01:08:00 am
content: Sorry, I just expressed my thoughts and hopes.I'm not good at coding,I would be grateful if you could help me

author: xrunner
author_rank: Super Contributor
timestamp: December 17, 2023, 01:54:26 am
content: Well, here's what you started with -Quote from: daisizhou on December 15, 2023, 02:29:51 amYou told us you are a novice programmer, and that is OK to admit. However, you can't really tackle a project like this yourself if you haven't learned some programming skills. It just ain't gonna work for you. Sure people can tell you a lot about how to do this or that part of the project. But even if they did send you parts of the code for certain areas of the project, how are you going to integrate the tips into a working solution with no programming skills?Really, IMHO, you need to take a few weeks or months to learn the basic programming language of these typs of microcontrollers and associated peripherals and THEN try to do your project. There is no shortcut to it I'm afraid.

author: daisizhou
author_rank: Super Contributor
timestamp: December 17, 2023, 02:14:27 am
content: Thanks.I looked for a certain part of the code on the internet,For example, digital clock part, odometer part...I tried to put them together under the GC9A01 display and work together,In the end I failed.they cannot be displayed,Sometimes the IDE cannot complete compilation.I tried many times and made mistakes,I try to adjust the code.........In the end, it didn’t meet my expectations.

author: tooki
author_rank: Super Contributor
timestamp: December 17, 2023, 07:01:49 pm
content: Quote from: daisizhou on December 17, 2023, 02:14:27 amThat’s because you’re trying to run when you haven’t even learned to crawl, never mind walk. Your expectations are completely unrealistic.You need to start at the beginning with super basic stuff. Become good at that. Then add on complexity a bit at a time. You can’t just dive in, there’s too much you don’t know yet. (I say this as someone who is still a fairly novice programmer myself.)

author: coromonadalix
author_rank: Super Contributor
timestamp: December 18, 2023, 03:18:40 am
content: same here, you tried to add everything in somekind of a code in one shot without thruly understanding what you're doing in you other threadsame happening here ...and doing thing like this will burn your name hereand you have a way to go over the help and warnings sent to you, and act like it's nothing, people dont like that

author: daisizhou
author_rank: Super Contributor
timestamp: December 18, 2023, 03:24:32 am
content: Ok, I understand. I'm sorry

author: tooki
author_rank: Super Contributor
timestamp: December 18, 2023, 06:23:48 pm
content: The best apology/thanks is for you to follow the advice we give you and see you learn and succeed.