Announcement

Collapse
No announcement yet.

uOLED-96 CRASHES while executing code

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16


    that was a bit rude ESPsupport.

    I have mentioned in my first post that I'm not a pro programmer. That is why I came here for help. When building a menu, I don't see how else I could call the functions. I would really appreciate some suggestions. If there's another way to call the menus, please tell me. Thanks.

    Comment


    • #17


      hello ds1

      kaddrison went out of his way to help you by creating a code sample for you to understand the structure.

      Remember, there are no 'menu's - you are creating them yourself by structuring code to create functions.

      It is up to you to learn how to do it - and understand how to program.

      There are plenty of example for you to learn from, and you need a solid understanding of basic program flow, and what functions are before you go much further.

      You are creating just a menu, and have a long way to go to make that menu do something - so you will need to sharpen your skills by working with a lot more examples and learning how they work.
      Regards,
      Dave

      Comment


      • #18


        hi dave,

        if you followed the posts carefully you could see that kaddrison used the same coding i posted, but instead of the subroutines, he used functions. I thanked him for his time it was really nice of him to do so.

        But it still gave the same error as with my original coding. Im not the type to go around asking everybody to do my work for me. I am stuck and there's no other place or people who knows about these things. I did go through the samples provided and I searched all over the net, but I do not see any sample coding for 'menus'. Please don't get me wrong when I say menus there. The code I posted above is my original coding plus a little bits and peices of graphics I gathered from the sample coding.

        So please, instead of trying to make me look like a bad guy who is not devoting to his work, help me to solve this problem.

        ESPsupport suggested that I shouldn't call the mainmenu function recursively, OK thanks! I really appreciate it. ...but please suggest another way?

        Comment


        • #19


          Goodness me, no-one is trying to make you look like a 'bad guy'.

          You are a programmer - and part of your skill should be how to debug your own program.

          I do not see any sample coding for 'menus'
          There is no code for a menu - you make the module do whatever you want, in the style that you want. This is an acquired skill that requires rudimetary programming knowledge to make it work, and artistic skill to make it look nice.

          THe structure of how you make a menu with these modules is no different to any other language or environment.

          If you are getting an error in your program , work out how to isolate it to a small section, then learn to understand why it wont work.You can print values to the COM port, and you can also print to the screen.
          You have a complete toolkit at your fingertips.
          Regards,
          Dave

          Comment


          • #20


            dave,

            Please try to understand my situation, I have created the coding FOR the menus from what I know. I am not a professional programmer, maybe I am dumb, who knows.

            The coding that I created is giving me problems. So, I scratched my head a couple of times, I looked through the coding over and over again about 50 times. I tried calling the functions in different ways, but none of them gives a solution to my problem.

            To me, my coding looks correct, so I just want to know, if there is a problem that you can see with it. Please point it out. Let me know. I'm running out of time here. ESPsupport said that I am calling the functions recursively, which is not a good thing apparently, please give me a small 'hello world' pseudo code to start off with.

            Comment


            • #21


              I suggest you download and try these examples,
              they should help you.
              http://4d.websitetoolbox.com/post?SANDBOX0002-Tetris-on-uOLEDxxxG1%28GFX%29-3879805
              http://4d.websitetoolbox.com/post?SANDBOX0007-Lander-on-uOLED128G1%28GFX%29-4626803

              Both these programs use 'menu's.

              As far as your prog goes, I dont have time to look in depth sorry.
              If your program IS recusively calling a main part - you will eventually run out of stack - you said before
              I can go in and out of sub menus about 3 times, but when I try to go back in, the whole thing dissapears and there's nothing on the screen
              Which is exactly what will happen if you run the stack dry (just like any other machine/programming language would behave)

              But - what I would do to find the problem is:-

              1] Turn every menu ans sub menu 'screen' into a function and call it so recursion is not possible and it can be traced easily.

              1] Put progress reports to the teminal (or screen) here or there followed by 100msec delays
              (the delays are to allow the message to get out before the crash)

              2] Trace every part of the program till you find the culprit.
              Regards,
              Dave

              Comment


              • #22


                see now thats something to help me start cracking my head. Thanks alot dave. I'll get back to you guys if I have more questions....

                cheers...

                Comment


                • #23


                  .... THANKS everyone, it works now. The problem was recursion.... Thanks ESPsupport, Dave and kaddrison for all your support.

                  Comment

                  Working...
                  X