Need help newbie with menu and timer

Hello dear developers, do you have any developments or examples of building menus for 1602 (2004)? would be very grateful and examples of timer implementation on display

Iā€™m considering making something like this for my project, but havenā€™t decided if I need it. What kind of strategy did you have in mind? What have you researched, already? Thereā€™s already information on this subject in this very Forum? What kind of menu selection and tree and function did you have in mind?

I am trying to do a 4 channel PID with settings and and a running timer. There was a big question about the implementation of the timer and the formation of the menu, as I understand the timer is built from small logical blocks, then you need to somehow display it in the display with the ability to edit

Iā€™ve implemented PID in XOD, and it was super easy. It updates on the loop. You simply wire the out put to your control system, and you wire the PID input with the setpoint signal. If you want to control your loop-speed, then you use ā€œClockā€ node into some pulse node on your sketch. You can further control flow by using defer nodes, and thereā€™s a node in gweimer/utils library called ā€œallā€ that waits for all the pulses to come in. To reset anything, like a timer, then wire a button to the RST pin.
image

Thereā€™s also a whole thing about ā€œMUXā€ (Mutex) that control program flow.
https://xod.io/libs/gweimer/traffic-light-advanced/

Are you trying to put knobs onto the PID parameters? And have that output to the LCD? So, you coudl, for example, change the PID parameters with an Encoder/Buttons?

Iā€™m not clear on how your timer fits into all this? Is your timer counting up? Or down? Is the time defined by the user? Or the software? What is the timer even timing? Iā€™m interested in helping, but you have to be more specific. Maybe draw a sketch of what youā€™re trying to do?

Like, how many buttons and knobs to you have to work with? How many LCDā€™s? What do you want to show on the screen? What the menu structure you want, and what do you want it to do? How do you want to interact with it? Whereā€™s the schematic for what the data flow look like? How many of what? What do they do? How do you want it to work? The problem needs more details.

Plus, you still didnā€™t attach any xodball file.

Hereā€™s a sketch of a way to cycle through some PID valuesā€¦

LCD-screen-selection-with-duration-timer.xodball (22.3 KB)

Hereā€™s a 2D structure for a menu:

hereā€™s the code

nth-select-menu-structure.xodball (15.0 KB)

Re-arranged for flavor

1 Like

You are an amazing person, you have an amazing design, I need a timer for the task and adjusting the operating time of 2:00 pm and adjusting the coefficients, I plan to do the control on the encoder (3 buttons) and the display on the i2с.
I apologize for the long answer and thank you for your responsiveness, I will deal with the project in 2 days.

It looks like the timer youā€™re talking about is actually a ā€œReal Time Clockā€. You need an I2C RTC.
For adjusting PID parameters with the the buttons, you gotta get in the menu modeā€¦ Maybe use the Line 1 to select the mode (which explicit PID parameter), then adjust it on Line 2. A state machine may be a good way to go with for that, and @gweimer has given excellent examples of ā€œtraffic light
advancedā€ (actually some of the most impressive work Iā€™ve seen).

https://xod.io/libs/gweimer/traffic-light-advanced/

The strategy for the digits is to parse the value on the decimal ā€œ.ā€ , and handle the integer and the fraction separately. Green light for the integer, yellow for the fraction, and red light for the storage of the value in a buffer or new FRAM memory (We could use the #SDread, if someone could figure out how to read a file and parse out data into an array (would want variadic node out!!!)).

In any case, these topics are covered in the forum. Iā€™m searching for ā€œadjustā€ or ā€œadjust valueā€ or ā€œdisplay adjustā€ or ā€œRTCā€ or ā€œclockā€

Take a crack at it, and see what you can come up with. I know you can do it!

best,
~xodballxod~

I thought the clock could be implemented programmatically, but so there is only a ds1307 chip available, do we only need i2c or with a pulse output?

https://xod.io/docs/guide/rtc-example/

Arduino doesnā€™t do clocks well on its own. It only counts milli-seconds since boot, and the counter over-flows after a short period of time. Technically, you probably COULD program a clock, but it is going to be difficult, and it is not going to be all that accurate. Arduino can interface with Real Time Clock (RTC) modules designed for accurate time-keeping. Depending on the module chosen, there will be a way to set the time (should only be needed once; the RTC module will remember time after that, even when power is removed using its own battery), query the time, and maybe set alarms. To support this functionality, I2C interface is usually used to connect to RTC modules.

Thanks for the clarification, which module would you recommend for time reporting?
Is ds1307 with non-volatile memory suitable for i2c?

List of Hardware Here:
https://xod.io/docs/reference/supported-hardware/

any ds1307 i2c should work, fine.

Guys, I assembled the ds1307 module, looked at the nodes, so itā€™s just a real time clock, I need an adjustable timer for 1-180 minutes (approximately) to set the pid time work , can it be implemented on simple nodes without ds1307, or I donā€™t understand something ?? ?

test project.xodball (20.0 KB)

Is there a reason you cannot use ā€˜delayā€™ node for a timer?