Make a menu with an LCD screen in ATMega328p

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello everyone, I am new here and I hope I am not in the wrong category.
I have a problem and it is that I have been trying to develop a menu for an LCD screen with a shield keypad.
The idea is to do it in Atmel 7 but I still can't find an answer.
If anyone could give me an orientation or a brief answer, I would be grateful.

 

Here is a brief summary of what I plan to do.

I have a 16x2 LCD and Shield Lcd Keypad
I need the buttons of the arduino shield to be able to enter a menu and select a category and a value, and with that I would activate or deactivate a sensor.

Thank you very much and see you later

Last Edited: Sat. Nov 21, 2020 - 11:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If there’s Arduino code available, why not use that? It is only c/c++. At a minimum, you could use that code as a basis for your own interpretation.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Huber0616 wrote:
The idea is to do it in Atmel 7 but I still can't find an answer

You mean Atmel Studio 7 (now called Microchip Studio 7) ?

 

As far as doing the menus goes, there's nothing specific to the IDE or the microcontroller - so don't confine your googling to those 

 

There are plenty of examples available.

 

A common approach is to have a structure which defines the menu texts, and the functions to be used to action menu choices 

 

You could model that on a PC ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks to both of you for answering, I am also trying to draw similarities between the arduino and avr language, it is my first project and I still do not know how to look for things, I leave a video that I found and the result is similar to what I am looking for.
Thanks a lot

https://www.youtube.com/watch?v=...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Take a look at Dean's well-regarded setup.

 

https://github.com/abcminiuser/m...

 

I often use an approach that is much better in some ways (in terms of space efficiency & ease of use), but this is suitable.

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for responding so quickly, yes, I think I mean the same software, but I found it as Atmel Studio 7.
Could you recommend a place to see examples? This is my first project and I still don't know where to get reliable information
Thanks a lot

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, I'll check it right away

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Before you start any programming of menus you need to use this programming language first: ENGLISH

Think thoroughly and describe in detail what you want it to do & then approaches will start to appear & you should describe those possible approaches.  Come up with at least 3 or 4 ways, so you can compare pitfalls & benefits.

Be detailed in your use of ENGLISH programming & the rest will follow nicely.

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

There is no 'Arduino' or 'AVR' language - they are both C/C++ and the Arduino tools and AS7 use the same compiler. The main difference is the Arduino tools manage the libraries and the build for you.

 

AS7 can import Arduino projects if you so desire.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
There is no 'Arduino' or 'AVR' language - they are both C/C++

Indeed.

 

Hence the suggestion:

in #3, awneil wrote:
You could model that on a PC ...

It is the same C or C++ language - so you can forget about the details of LCDs and buttons, and concentrate on designing the menu functionality ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

the AVR butterfly code has a nice menu, although the LCD display is different, the concepts for the up/down/left/right/select buttons would be the same.

A menu is a state machine, see the tutorial forum for how state machines work.

Jim

Edit : added SM text

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

Last Edited: Tue. Nov 24, 2020 - 02:09 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:
the AVR butterfly code has a nice menu
Arguably Dean then made a "better" version of that...

 

https://github.com/abcminiuser/m...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

Arguably Dean then made a "better" version of that...

Thanks, I did not know that, I'll take a look and download a copy! smiley

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"