I have successfully implemented it, but there is a small issue that I haven't been able to resolve yet. When the plus or minus button is pressed, the value increases or decreases by 2 instead of 1, as it should. For example, when the value is at 1 and I press the plus button once, the displayed value jumps to 3, and I notice that the number 2 is briefly shown for a very short moment. Could you explain what is happening and how to fix it? Thank you
As the display is updating twice when the incorrect change happens, the action must be a combination of 2 loops, each time triggering the "PressButton" class "Repeated()" function, causing and add or subtract to happend twice. The problem is likely because of some typo in this function (see @26:54), the button state is either not being set correctly, or being checked correctly, resulting in the double trigger (likely you are not clearing the "WasDown" flag in the first "if" section @27:42). Take a close look at this function and see if you can understand what is going on, and ultimately fix the problem. It could also be useful to check the earlier episode where I talk about this function in more detail (though it is modified a little in this new episode). Good luck!
Sorry mate, not sharing the code, and not simply making it easy as a copy & paste, is my intended method of teaching. Seems a lot of people like it and have had success, but some people don't like it (i.e. this video is not for those people). Ultimately it takes me at least 50 times longer to make these videos compared to the time taken to write the actual code, so I don't think it is such a big ask that people type this in themselves should they be seriously interested in learning how to code. Thanks for the comment!
This is a useful lesson - is it possible to change the setting values if you only have 4 buttons. If I create a Menü then I have only two or three button. So I use the combinations of pressing two buttons the same time. I like the LCD with 80 chars.
@@viktorhugo8252 In episode 6 of this series, I do demonstrate how you can navigate a settings menu with only 4 buttons. It's using an older version of this code, but you could still implement that concept with this newer code too. Of course 6 buttons will always be easier to code and easier for the user. Thanks for the question!
I was wondering what program you are using to write the code? It appears to be far superior to Arduino IDE. Can you post a link, so I can check it out. Thanks Pete
At 33:56 I define the numbers of rows as "DISP_ITEMS_ROWS = 3", if you change this to be "1" it should scroll in a single row (but I have not tested it). Good luck with your project, and please watch the video carefully and try to understand the best you can, if you can understand it well, then it should be easy enough to modify this code to fit most display style requirements.
@@ForOurGood I've tried that it worked but i also wanted to place my menu in the 4th row i have change things and it keep start in second row how do i change that
@@RNDHVAC Ok, so I understand you have got the single row scrolling menu working on the second row, but you want it on the 4th. The "menuItemPrintable" routine not only returns a positive state if the item is to be printed, but it is also responsible for locating the cursor. So the easiest way to push it down would be to add "+2" to the calculation for the Y-pos in the "lcd.setCursor" routine. Ideally you would be better adding a define for this offset value, and then adding this define value as opposed to hard coding the offset value.
I ported your menu system to an ESP32. Everything works wonderfully, but I wasn't able to achieve values up to 10,000 in the settings. Can you help me with this problem? Thank you
First, you are going to need to right size your variable. To support values up to 10K you will at least need to use a “uint16_t”, and not the “uint8_t” I have shown in the demonstration (Always make sure you understand, and are using the correct variable types). Second, you will need to change the number modifying routine so that it supports up to a non-signed 16bit variable (uint16_t), and that is as simple as changing it to “void adjustUint16_t(uint16_t *v, uint16_t min, uint16_t max)”. Finally, make sure your display layout can support the number of digits you are trying to show. And that’s about all the advice I can think of right now. Happy New Year!
I think I showed that in episode 4 of this series, check it out. There are also plenty of other channels on TH-cam that go into this topic in more depth. Should not be difficult.
Your video is very good I ported your menu system to an ESP32. When it's done, everything is done. Check the LCD and the values in setting #2,3,4,6 are flashing continuously, it seems like the previous value overlaps the next value (ex: setting #2 59 overlaps 60). , and the plus and minus buttons are not working properly, the code is exactly the same as in the video because I have checked it many times. Can you help me with this problem? Thank you !!!
Please tell me the port assignments you are using for the ESP32. Also, I assume you step by step followed the video, so please tell me the timestamp in the video where your testing and my testing did not match anymore.
@@ForOurGood drive.google.com/drive/folders/1gfArUGxQSZZRa7qmekmvK5lJCL4sr5qX?usp=sharing Can you go to my Google Drive to see the code image and test video on the LCD to help fix the error? thank you
@@ForOurGood drive.google.com/drive/folders/1gfArUGxQSZZRa7qmekmvK5lJCL4sr5qX?usp=sharing Can you go to my Google Drive to see the code image and test video on the LCD to help fix the error? thank you !
@ForOurGood drive.google.com/drive/folders/1gfArUGxQSZZRa7qmekmvK5lJCL4sr5qX?usp=sharing Can you go to my Google Drive to see the code image and test video on the LCD to help fix the error? thank you
@@ForOurGood Can you go to my Google Drive to see the code image and test video on the LCD to help fix the error? drive.google.com/drive/folders/1gfArUGxQSZZRa7qmekmvK5lJCL4sr5qX?usp=sharing thank you
Hi. Im trying to do a menu in the LCD but I have a problem, my code compiles and everything but the problems is in the LCD, when I set the cursor in the option that I want to select ( the cursor is an ">") but the submenu or the suboptions inside of the option where the cursor is, The suboptions appear beneath the option without even selecting them, I think the problems is the LCD, becuase it sparkles and doesnt even show some words; besides, Ive bee checking the code severla times and It does not seem to be the problem. What would you recommend me to do? Btw, great video, love the large videos when you put the whole code from the beginning instead of just showing it
I know you already checked your code, but I would still suggest you suspect a problem with the code instead of trying to pin the problem elsewhere (actually, I always made this same mistake, and I still often need to remind myself, this is normal human behavior). I suggest trying to come up with some small simple test code if you can, to try to understand what is, and is not working with the LCD (try to prove it is really broken). It's not impossible the LCD is the problem, just extremely unlikely in my experience. My idea with this video format is so that you can follow along, each step of the way you need to check to see you are getting the exact same result I demonstrated. In that way, if you have a problem, you should be able to isolate the problem to a smaller area of code, and hopefully be able to solve it yourself. Additionally, if you can tell me which particular point in the video you are getting stuck, and explain the exact symptoms, it will help me in understanding the problem and suggesting possible solutions. Unfortunately, with the information you provided here I can’t provide any specific ideas on what might be the problem in your code.. Anyway, I am happy to hear the videos are useful to you, because they really suck to make, and really they don’t get that many views considering the work involved..
@@ForOurGoodsure, and thanks. Well in my code the root menu has two options "program" and "change date" when you select the first option it is supossed to clear the LCD and show a new menu wich has seven options "Monday" to "Sunday" and every single one of them has 3 options once you select one of them "First hour" "second hour" and "third hour" and when you select one of them it clears the LCD screen and shows a message "You have selected this option (according to the day and the hour)" and the other option in the root menu wich is "change date" just shows a mesaage wich says "You have chosen change date". And the problem when the cursor wich is an ">" is pointing in the "program" option, it shows the option Monday beneath the word "program" and also "Wednesday" above, and without even selecting them, also in the first letters in the word "program" you can see "Sund" overwrite in the word, and I end up with the conclusion that the problem was the LCD because when I put the cursor pointing to "change date" the mistakes that i mentioned dissappear but the words seem to sparkle, like they appear and also dissappear whenever they want. And the thing about the videos, they are great for me, for I'd say some people dont like large videos, perhaps you should consider to add also short videos, like 10 min.
Difficult to debug someone’s code remotely without seeing it, but let me try! First, there is no problem with the LCD, there are some bugs in your code. I can confirm this because you state that the display shows other menu information "without even selecting them", clearly that has nothing to do with the LCD. For me I can see actually 2 different types of bugs (possibly with some crossover). The first bug is related to the "sparkling" when selecting the second item. This is likely caused because the display is updating unnecessarily for some reason, and rapidly at that, causing the sparkle. It is also likely you are not pacing the loop, similar to the bug I made and showed @1:01:16. The second bug is related to the fact that the sub menu text is being overlayed on the root menu, even though you have not even selected. Hard to be specific here, but it is clear that you have a bug where it is branching off at some point and running some part of the sub menus code. Honestly, it looks like you’re struggling a bit, and that is ok, and all a part of learning. My recommendation to you is step though this video, typing it in word for word, and try to understand everything the best you can as you go. At each step confirm you are getting the exact result I am demonstrating, and at the end you should have a functional menu structure working exactly as I demonstrate. The next step would be to slowly, step by step, modify the code until it matches what you are trying to do. Good luck.@@edfriedrich.
@@ForOurGood Thanks, I found the solution by changing the code to show the menu in the serial monitor and I spot the mistake, it was an error in the void menu. I did not use your code, but it helped me out in the process, thanks.
Hello sir, i really do appriciate ur work and really understand why u never choose to share your code and i really made a functional menu with your lession and i can prove i do learn and implimented just knowledge provided on ur videos but now m stuck on a place as m using tft-espi library and on my menu system their is a pointer arrow and also white box around my menu item to show pointer but now m stuck i cant figure it out scrolling vertically as shown on this video also i wanna implement if my menu item text is bigger than box m m using to show point then i want my text to scoll horizontally but as off now on my understand i did make that printmenufunction and i do impliment a logic like if its bigger than box then scroll the text else just print inside box also before this logis i do provide condition as u mentioned comparing value with subpos but issue is as i hv to call that print function as many times as how many items i want so if in middle one menu item text is bigger that scrolling function takes time and hold subsequent function to execute now wht to do and also i really cant understand logic behind verticle scrolling can you help me please
It sounds like you have a good general understanding, and I also understand what you are trying to do with the oversized string. Typically I try to avoid such complications, and therefore have not tried it myself in Arduino, but generally it should not be so hard to do. First, just get the menu to work without the oversized text issue, only then move on to solving the oversized text. Now you should be able to modify the printmenuitem subroutine so it can deal with the oversized text when the item is selected. You will also need some text offset variable that the Printmenuitem will manipulate each time it is called and does the offset for the selected item. The final problem is when to update. As it is, the update is only done when the lineup changes, but now we also need to update at a given animation speed. If it was me, I would try to use the same animation counter for the pointer. If the pointer will change flash state, then I would force a chance to update the menu lineup, but in this case I would add additional logic so that only the selected item actually updates, which in turn would shift the offset. Hope that makes sense! I am just thinking it out in my head, so maybe I am just talking nonsense. Glad you found the videos useful and great to hear you're making a real effort to learn. Good luck!
@@ForOurGood thanks a lot for reponse me i really do appriciate and if u wanna look my code once that would be quite nice for me but i really do wanna mention one thing all doing these thing as our hobby take your time am here and its really fasinating everytime i do watch your videos i do learn more new things and one context i should tell i really do excite how opensource runs our whole internet and there is people there who put there time and energy to teach and help new comer if some day i can help you thats would be a great opportunity for me
@@ForOurGood i can provide my github repo link as i do update my codes as if someone would get inspiration to learn something or help me make my project otherwise atleast maintaining on github help me recover my mistakes
@@riteshpradhan9328 You already help me simply by watching and learning, giving me relief I am not just wasting my time, and that's enough for me! One day in the future, I am sure you will help someone else to learn what you have learnt too.
@@ForOurGood do u want to check my code once ? Coz i guess that will clarify how i implimented things here and then i can get some suggestion how not to do certaing things
I would like to use your code to control how far a stepper motor movers. Specifically, modify test # 2 of the code so than I can adjust it in 0.01 increments rather than whole numbers. From what I have read, I need to use a float rather than an interger. Can you show me how to modify the code, or direct me to some reference material so I can do it. I think these are the correct line numbers for your code. Line 68) void adjustUint8_t(uint8_t *v, uint8_t min, uint8_t max); Line 83) uint8_t Test2_Num = 60; Line 507) if (menuItemPrintable(1, 2)){lcd.print(F("Setting #2 = "));} Line 520) if (menuItemPrintable(14, 2)){printUint32_tAtWidth(settings.Test2_Num, 3, ' ', false);} Line 549) case 2: adjustUint8_t(&settings.Test2_Num, 0, 255); break; Line 635) void adjustUint8_t (uint8_t *v, uint8_t min, uint8_t max){ Line 637) if (btnPlus.RepeatCnt == 0 && btnMinus.Repeated()){if (*v > min){*v = *v - 1; updateItemValue = true;}} Line 639) if (btnMinus.RepeatCnt == 0 && btnPlus.Repeated()){if (*v < max){*v = *v + 1; updateItemValue = true;}} Line 640) } Thanks Pete
As a general rule I don’t give direct feedback or provide viewers with specific code for their projects, because that would become too overwhelming. However, I can provide you with some advice, and hopefully point you in the right direction. The first golden tip I can provide (from suffering a lot of pain myself), is that AVOID USING FLOATS wherever possible, they are totally broken in Arduino and give inconsistent and confusing results. Now with that out of the way, what I recommend you do is work in whole numbers that are a multiple of a fraction, for example the value could represent a quantity of a thousandths. To give yourself an appropriate range, you will want to use a big integer for this, signed or unsigned depending upon your requirement, for example a int64 or a unit64, but it could be smaller variable type too. A int64 has a max value of 9,223,372,036,854,775,807, so even if you used a billionth fraction representation, that still gives you a max whole number value of 9,223,372,036 with huge fractional precision. Where ever possible you will manipulate the value in its native form, but taking into account its fractional nature. Finally, only in cases where it is absolutely necessary to use the value as a float, at that point in the code covert the value back to a float using something like “float(myValue/1000)”. Hope that helps, and thanks for the question!
Funny you should ask, I was just working on that. But it might take me a little time to prepare. In the meantime, please enjoy watching all my other videos 😁. Thanks for your comment and query.
I am not sure what you mean. Is your question "Do you think to make this program with rotary encoder (knob) ?". I have used a potentiometer+knob in my Mini-lathe project to control the speed, but I have not used it to manage the menu yet. Maybe in the future I will show how to do a menu with a knob.
Could you show all the finished code at once? because I watched the entire video and you went back and forth many times and modified many things and I missed a lot😃
Hi Giovanni, I am sorry you have some trouble, that is a part of learning, but please be assurred that many other people have confirmed the menu works fine. I don't release the code intentionally, to increase the chance you will learn more by doing, and solving the problems yourself. I suggest you follow the video step by step, confirming that the results you are getting at each step exactly match what I am demonstrating, and if at any point it does not match, then focus on that area, and see if you can solve the problem. Writing code is not always fun, but it can be rewarding when you understand and get things to work as you expected. Good luck!
Wow. You talk really fast. I was exhausted in five minutes. I guess I'm just not cut out for learning in this way. Thanks anyway. Good information I'm sure.
@@snakezdewiggle6084 actually my accent is pretty weak in these videos, just keep a little in there to keep it interesting. The truth is I just speak too fast, I have often been told that, it does put some people off. But actually when there is so much to get through in a single video, speaking fast is actually unavoidable.
@ForOurGood Please, like all TH-camrs are doing, create audio and multiple languages for your video. TH-cam has this configuration. I speak Portuguese, I love the subject, but it is not possible to understand English.
@@makeryourself4435 I did some research on this topic, and it would require me to actually pay someone to translate my videos.. and as my hundreds of hours of work making these lessons is already completely charity, it is impossible for me to spend out of pocket to add extra language tracks.. I am sorry. The good news is you can still use the automatically generated subtitles in your preferred language, and even though it is not great, it is better than nothing. I do have many non-English speaking viewers who have found this series useful, so hopefully that is the same for you. In any case, thank you for bringing it to my attention, at least I am now aware of the capability and how to use it.
Attention ESP32 users. Please check my community post with things you should be aware of when implementing this project on a ESP32.
What an amazing video. This is definately something I can use as a template for future projects. Thanks for taking the time to make it.
You're very welcome!
Hi, can you share the sketch?
I have successfully implemented it, but there is a small issue that I haven't been able to resolve yet. When the plus or minus button is pressed, the value increases or decreases by 2 instead of 1, as it should. For example, when the value is at 1 and I press the plus button once, the displayed value jumps to 3, and I notice that the number 2 is briefly shown for a very short moment. Could you explain what is happening and how to fix it? Thank you
As the display is updating twice when the incorrect change happens, the action must be a combination of 2 loops, each time triggering the "PressButton" class "Repeated()" function, causing and add or subtract to happend twice. The problem is likely because of some typo in this function (see @26:54), the button state is either not being set correctly, or being checked correctly, resulting in the double trigger (likely you are not clearing the "WasDown" flag in the first "if" section @27:42). Take a close look at this function and see if you can understand what is going on, and ultimately fix the problem. It could also be useful to check the earlier episode where I talk about this function in more detail (though it is modified a little in this new episode).
Good luck!
@ Thank you for your explanation and quick response. I will immediately work on fixing the code and will update you once it functions as expected.
Can you please share the code you use in your videos? It's very difficult to write it all from the video!
Sorry mate, not sharing the code, and not simply making it easy as a copy & paste, is my intended method of teaching. Seems a lot of people like it and have had success, but some people don't like it (i.e. this video is not for those people).
Ultimately it takes me at least 50 times longer to make these videos compared to the time taken to write the actual code, so I don't think it is such a big ask that people type this in themselves should they be seriously interested in learning how to code.
Thanks for the comment!
This is a useful lesson - is it possible to change the setting values if you only have 4 buttons. If I create a Menü then I have only two or three button. So I use the combinations of pressing two buttons the same time. I like the LCD with 80 chars.
@@viktorhugo8252 In episode 6 of this series, I do demonstrate how you can navigate a settings menu with only 4 buttons.
It's using an older version of this code, but you could still implement that concept with this newer code too.
Of course 6 buttons will always be easier to code and easier for the user.
Thanks for the question!
I was wondering what program you are using to write the code? It appears to be far superior to Arduino IDE. Can you post a link, so I can check it out. Thanks Pete
Please check EP4 where I discuss this in detail.
hi can you help me? i follow your code and if i wanted to make the menu scroll in single/one row what do i change?
@@RNDHVAC what is the size of your display?
@@ForOurGood 20 x4 sir
At 33:56 I define the numbers of rows as "DISP_ITEMS_ROWS = 3", if you change this to be "1" it should scroll in a single row (but I have not tested it). Good luck with your project, and please watch the video carefully and try to understand the best you can, if you can understand it well, then it should be easy enough to modify this code to fit most display style requirements.
@@ForOurGood I've tried that it worked but i also wanted to place my menu in the 4th row i have change things and it keep start in second row how do i change that
@@RNDHVAC Ok, so I understand you have got the single row scrolling menu working on the second row, but you want it on the 4th. The "menuItemPrintable" routine not only returns a positive state if the item is to be printed, but it is also responsible for locating the cursor. So the easiest way to push it down would be to add "+2" to the calculation for the Y-pos in the "lcd.setCursor" routine. Ideally you would be better adding a define for this offset value, and then adding this define value as opposed to hard coding the offset value.
I ported your menu system to an ESP32.
Everything works wonderfully, but I wasn't able to achieve values up to 10,000 in the settings.
Can you help me with this problem?
Thank you
First, you are going to need to right size your variable. To support values up to 10K you will at least need to use a “uint16_t”, and not the “uint8_t” I have shown in the demonstration (Always make sure you understand, and are using the correct variable types). Second, you will need to change the number modifying routine so that it supports up to a non-signed 16bit variable (uint16_t), and that is as simple as changing it to “void adjustUint16_t(uint16_t *v, uint16_t min, uint16_t max)”. Finally, make sure your display layout can support the number of digits you are trying to show. And that’s about all the advice I can think of right now. Happy New Year!
How do I get Platform IO. Every thing I try will not work.
I think I showed that in episode 4 of this series, check it out. There are also plenty of other channels on TH-cam that go into this topic in more depth. Should not be difficult.
@ForOurGood
Thanks for the reply. EP 4 is the one. I think I'll stick with writing assembler in txt files, so much faster for debugging.
Your video is very good
I ported your menu system to an ESP32.
When it's done, everything is done. Check the LCD and the values in setting #2,3,4,6 are flashing continuously, it seems like the previous value overlaps the next value (ex: setting #2 59 overlaps 60). , and the plus and minus buttons are not working properly, the code is exactly the same as in the video because I have checked it many times.
Can you help me with this problem?
Thank you !!!
Please tell me the port assignments you are using for the ESP32. Also, I assume you step by step followed the video, so please tell me the timestamp in the video where your testing and my testing did not match anymore.
@@ForOurGood drive.google.com/drive/folders/1gfArUGxQSZZRa7qmekmvK5lJCL4sr5qX?usp=sharing
Can you go to my Google Drive to see the code image and test video on the LCD to help fix the error?
thank you
@@ForOurGood drive.google.com/drive/folders/1gfArUGxQSZZRa7qmekmvK5lJCL4sr5qX?usp=sharing
Can you go to my Google Drive to see the code image and test video on the LCD to help fix the error?
thank you !
@ForOurGood drive.google.com/drive/folders/1gfArUGxQSZZRa7qmekmvK5lJCL4sr5qX?usp=sharing
Can you go to my Google Drive to see the code image and test video on the LCD to help fix the error?
thank you
@@ForOurGood Can you go to my Google Drive to see the code image and test video on the LCD to help fix the error?
drive.google.com/drive/folders/1gfArUGxQSZZRa7qmekmvK5lJCL4sr5qX?usp=sharing
thank you
Hi. Im trying to do a menu in the LCD but I have a problem, my code compiles and everything but the problems is in the LCD, when I set the cursor in the option that I want to select ( the cursor is an ">") but the submenu or the suboptions inside of the option where the cursor is, The suboptions appear beneath the option without even selecting them, I think the problems is the LCD, becuase it sparkles and doesnt even show some words; besides, Ive bee checking the code severla times and It does not seem to be the problem. What would you recommend me to do? Btw, great video, love the large videos when you put the whole code from the beginning instead of just showing it
I know you already checked your code, but I would still suggest you suspect a problem with the code instead of trying to pin the problem elsewhere (actually, I always made this same mistake, and I still often need to remind myself, this is normal human behavior). I suggest trying to come up with some small simple test code if you can, to try to understand what is, and is not working with the LCD (try to prove it is really broken). It's not impossible the LCD is the problem, just extremely unlikely in my experience. My idea with this video format is so that you can follow along, each step of the way you need to check to see you are getting the exact same result I demonstrated. In that way, if you have a problem, you should be able to isolate the problem to a smaller area of code, and hopefully be able to solve it yourself. Additionally, if you can tell me which particular point in the video you are getting stuck, and explain the exact symptoms, it will help me in understanding the problem and suggesting possible solutions. Unfortunately, with the information you provided here I can’t provide any specific ideas on what might be the problem in your code.. Anyway, I am happy to hear the videos are useful to you, because they really suck to make, and really they don’t get that many views considering the work involved..
@@ForOurGoodsure, and thanks. Well in my code the root menu has two options "program" and "change date" when you select the first option it is supossed to clear the LCD and show a new menu wich has seven options "Monday" to "Sunday" and every single one of them has 3 options once you select one of them "First hour" "second hour" and "third hour" and when you select one of them it clears the LCD screen and shows a message "You have selected this option (according to the day and the hour)" and the other option in the root menu wich is "change date" just shows a mesaage wich says "You have chosen change date". And the problem when the cursor wich is an ">" is pointing in the "program" option, it shows the option Monday beneath the word "program" and also "Wednesday" above, and without even selecting them, also in the first letters in the word "program" you can see "Sund" overwrite in the word, and I end up with the conclusion that the problem was the LCD because when I put the cursor pointing to "change date" the mistakes that i mentioned dissappear but the words seem to sparkle, like they appear and also dissappear whenever they want.
And the thing about the videos, they are great for me, for I'd say some people dont like large videos, perhaps you should consider to add also short videos, like 10 min.
Difficult to debug someone’s code remotely without seeing it, but let me try! First, there is no problem with the LCD, there are some bugs in your code. I can confirm this because you state that the display shows other menu information "without even selecting them", clearly that has nothing to do with the LCD. For me I can see actually 2 different types of bugs (possibly with some crossover). The first bug is related to the "sparkling" when selecting the second item. This is likely caused because the display is updating unnecessarily for some reason, and rapidly at that, causing the sparkle. It is also likely you are not pacing the loop, similar to the bug I made and showed @1:01:16. The second bug is related to the fact that the sub menu text is being overlayed on the root menu, even though you have not even selected. Hard to be specific here, but it is clear that you have a bug where it is branching off at some point and running some part of the sub menus code. Honestly, it looks like you’re struggling a bit, and that is ok, and all a part of learning. My recommendation to you is step though this video, typing it in word for word, and try to understand everything the best you can as you go. At each step confirm you are getting the exact result I am demonstrating, and at the end you should have a functional menu structure working exactly as I demonstrate. The next step would be to slowly, step by step, modify the code until it matches what you are trying to do. Good luck.@@edfriedrich.
@@ForOurGood Thanks, I found the solution by changing the code to show the menu in the serial monitor and I spot the mistake, it was an error in the void menu. I did not use your code, but it helped me out in the process, thanks.
Well done! @@edfriedrich.
Sir super but ples code on oled menu sir
Hello sir, i really do appriciate ur work and really understand why u never choose to share your code and i really made a functional menu with your lession and i can prove i do learn and implimented just knowledge provided on ur videos but now m stuck on a place as m using tft-espi library and on my menu system their is a pointer arrow and also white box around my menu item to show pointer but now m stuck i cant figure it out scrolling vertically as shown on this video also i wanna implement if my menu item text is bigger than box m m using to show point then i want my text to scoll horizontally but as off now on my understand i did make that printmenufunction and i do impliment a logic like if its bigger than box then scroll the text else just print inside box also before this logis i do provide condition as u mentioned comparing value with subpos but issue is as i hv to call that print function as many times as how many items i want so if in middle one menu item text is bigger that scrolling function takes time and hold subsequent function to execute now wht to do and also i really cant understand logic behind verticle scrolling can you help me please
It sounds like you have a good general understanding, and I also understand what you are trying to do with the oversized string. Typically I try to avoid such complications, and therefore have not tried it myself in Arduino, but generally it should not be so hard to do. First, just get the menu to work without the oversized text issue, only then move on to solving the oversized text. Now you should be able to modify the printmenuitem subroutine so it can deal with the oversized text when the item is selected. You will also need some text offset variable that the Printmenuitem will manipulate each time it is called and does the offset for the selected item. The final problem is when to update. As it is, the update is only done when the lineup changes, but now we also need to update at a given animation speed. If it was me, I would try to use the same animation counter for the pointer. If the pointer will change flash state, then I would force a chance to update the menu lineup, but in this case I would add additional logic so that only the selected item actually updates, which in turn would shift the offset. Hope that makes sense! I am just thinking it out in my head, so maybe I am just talking nonsense. Glad you found the videos useful and great to hear you're making a real effort to learn. Good luck!
@@ForOurGood thanks a lot for reponse me i really do appriciate and if u wanna look my code once that would be quite nice for me but i really do wanna mention one thing all doing these thing as our hobby take your time am here and its really fasinating everytime i do watch your videos i do learn more new things and one context i should tell i really do excite how opensource runs our whole internet and there is people there who put there time and energy to teach and help new comer if some day i can help you thats would be a great opportunity for me
@@ForOurGood i can provide my github repo link as i do update my codes as if someone would get inspiration to learn something or help me make my project otherwise atleast maintaining on github help me recover my mistakes
@@riteshpradhan9328 You already help me simply by watching and learning, giving me relief I am not just wasting my time, and that's enough for me! One day in the future, I am sure you will help someone else to learn what you have learnt too.
@@ForOurGood do u want to check my code once ? Coz i guess that will clarify how i implimented things here and then i can get some suggestion how not to do certaing things
I would like to use your code to control how far a stepper motor movers. Specifically, modify test # 2 of the code so than I can adjust it in 0.01 increments rather than whole numbers. From what I have read, I need to use a float rather than an interger. Can you show me how to modify the code, or direct me to some reference material so I can do it.
I think these are the correct line numbers for your code.
Line 68) void adjustUint8_t(uint8_t *v, uint8_t min, uint8_t max);
Line 83) uint8_t Test2_Num = 60;
Line 507) if (menuItemPrintable(1, 2)){lcd.print(F("Setting #2 = "));}
Line 520) if (menuItemPrintable(14, 2)){printUint32_tAtWidth(settings.Test2_Num, 3, ' ', false);}
Line 549) case 2: adjustUint8_t(&settings.Test2_Num, 0, 255); break;
Line 635) void adjustUint8_t (uint8_t *v, uint8_t min, uint8_t max){
Line 637) if (btnPlus.RepeatCnt == 0 && btnMinus.Repeated()){if (*v > min){*v = *v - 1; updateItemValue = true;}}
Line 639) if (btnMinus.RepeatCnt == 0 && btnPlus.Repeated()){if (*v < max){*v = *v + 1; updateItemValue = true;}}
Line 640) }
Thanks Pete
As a general rule I don’t give direct feedback or provide viewers with specific code for their projects, because that would become too overwhelming. However, I can provide you with some advice, and hopefully point you in the right direction. The first golden tip I can provide (from suffering a lot of pain myself), is that AVOID USING FLOATS wherever possible, they are totally broken in Arduino and give inconsistent and confusing results. Now with that out of the way, what I recommend you do is work in whole numbers that are a multiple of a fraction, for example the value could represent a quantity of a thousandths. To give yourself an appropriate range, you will want to use a big integer for this, signed or unsigned depending upon your requirement, for example a int64 or a unit64, but it could be smaller variable type too. A int64 has a max value of 9,223,372,036,854,775,807, so even if you used a billionth fraction representation, that still gives you a max whole number value of 9,223,372,036 with huge fractional precision. Where ever possible you will manipulate the value in its native form, but taking into account its fractional nature. Finally, only in cases where it is absolutely necessary to use the value as a float, at that point in the code covert the value back to a float using something like “float(myValue/1000)”.
Hope that helps, and thanks for the question!
@@ForOurGood Thanks for the advice. I will see if I can alter it and use to represent 1000ths rather than floats.
@@Pete-pp7kt actually probably needs to be "float(myValue)/1000" at the final use point. My brain was not working..
Can you share the code
Funny you should ask, I was just working on that. But it might take me a little time to prepare. In the meantime, please enjoy watching all my other videos 😁. Thanks for your comment and query.
DO YOU THİNK THİS PROGRAM WİTH ENCODER ?
I am not sure what you mean. Is your question "Do you think to make this program with rotary encoder (knob) ?". I have used a potentiometer+knob in my Mini-lathe project to control the speed, but I have not used it to manage the menu yet. Maybe in the future I will show how to do a menu with a knob.
@@ForOurGood I'll FOLLOWED...
good work but where is code ???
Thanks for the easy question! I put all the code in the video, so you can do good work too. Please enjoy 😉
Could you show all the finished code at once? because I watched the entire video and you went back and forth many times and modified many things and I missed a lot😃
Hi Giovanni,
I am sorry you have some trouble, that is a part of learning, but please be assurred that many other people have confirmed the menu works fine.
I don't release the code intentionally, to increase the chance you will learn more by doing, and solving the problems yourself.
I suggest you follow the video step by step, confirming that the results you are getting at each step exactly match what I am demonstrating, and if at any point it does not match, then focus on that area, and see if you can solve the problem.
Writing code is not always fun, but it can be rewarding when you understand and get things to work as you expected.
Good luck!
Thank You
You're very welcome!
Very good tutorial! Thank you.
You're very welcome!
Wow. You talk really fast. I was exhausted in five minutes. I guess I'm just not cut out for learning in this way. Thanks anyway. Good information I'm sure.
Hope you eventually find something that works for you. Thanks for taking the time to comment!
@ForOurGood
Its probably that Aussie accent 😉
@@snakezdewiggle6084 actually my accent is pretty weak in these videos, just keep a little in there to keep it interesting. The truth is I just speak too fast, I have often been told that, it does put some people off. But actually when there is so much to get through in a single video, speaking fast is actually unavoidable.
Just brilliant tutorial... thank u
@@fooballers7883 Happy to hear it was useful for you! And thanks for leaving the comment 🙂
@ForOurGood Please, like all TH-camrs are doing, create audio and multiple languages for your video. TH-cam has this configuration. I speak Portuguese, I love the subject, but it is not possible to understand English.
@@makeryourself4435 I will check it out! Thanks.
@@makeryourself4435 I did some research on this topic, and it would require me to actually pay someone to translate my videos.. and as my hundreds of hours of work making these lessons is already completely charity, it is impossible for me to spend out of pocket to add extra language tracks.. I am sorry. The good news is you can still use the automatically generated subtitles in your preferred language, and even though it is not great, it is better than nothing. I do have many non-English speaking viewers who have found this series useful, so hopefully that is the same for you. In any case, thank you for bringing it to my attention, at least I am now aware of the capability and how to use it.