Announcement

Collapse
No announcement yet.

Write to SD Card, Program no longer works

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Write to SD Card, Program no longer works

    Hi, I'm struggling here on the last step of my project. nfortunately it is due this weekend. Everything is working except for this one problem.
    When I run my program, all outputs work correctly, I press the start button and when I click stop, the arduino writes to the file. This is where it all breaks down. From this point, my project becomes useless and will not function. When I comment the write function everything runs. Please Help

    Regards,
    William
    Attached Files

  • #2
    Hi William,

    Thanks for sending us your project. I will re-create your setup and try to find the reason why. Please bear with me for a short while and hopefully we can this working as expected.

    Best regards

    Paul

    Comment


    • #3
      Hi William

      I looked through your Arduino code and I can't see anything obvious.

      Would it be possible to zip your Workshop project by clicking on File then Zip project and send the created zip in the project directory to me.

      Best regards

      Paul

      Comment


      • #4
        Hi Paul,

        The project is attached to the first post. Please see attached here also.

        Thanks and Regards,
        William
        Attached Files

        Comment


        • #5
          Thank you,

          I was missing a lot of files previously. I will go through it shortly.

          Best regards

          Paul

          Comment


          • #6
            Oh Sorry Paul, I hadn't actually checked the zipped files previously. Thanks very much

            Comment


            • #7
              Hi William,

              I had a look at your ViSi Genie project and I didn't notice anything obvious.

              Can you try opening MagicObject0 and comment the line
              Code:
              serout(ACK);
              at the end?

              Please let me know how this would affect your project.

              Regards,
              Juniel Cruz

              Comment


              • #8
                Hello Juniel,

                Yes, this does make the program stop freezing, however, it makes the program slower overall. Is there a way that I can disable the ack without slowing down the program. I added an if statement that only disables the ACK for MFILE_WRITE. However, This still causes the program to run slow. It is like the arduino and screen lose syncronisation if the ACK is not sent after write. If the ACK is sent after write it disables the function of the program altogether. Is there a way to overcome this?

                Thanks and Regards,
                William

                Comment


                • #9
                  Hi William,

                  Testing the Genie code with GTX in the Tools menu and the serout(ACK) left uncommented it seems to work fine. It is very hard for me to test with the Arduino attached as the buttons just seem to operate and nothing really happens. I noticed that your project is set to run from COM1, is this the way you are using it from COM1 of the display ?

                  Best regards

                  Paul

                  Comment


                  • #10
                    If you are running from COM1 on the display then please try uncommenting the serout(ACK); and remove the if statement you added. When using COM1 you need to write to the COM1 port so you will need to change the serout(ACK); to serout1(ACK);

                    Comment


                    • #11
                      Hey Paul,

                      I am using COM1 on the Arduino, However, my 4d screen is set up for com0. Does this need to be changed?
                      I have tried testing in the GTX tool previously as this is how I tested the write/read firstly. The issue I have here is I do not have my arduino code which disables the buttons afterwards the start becomes a stop button. The issue I am seeing with the ACK commented is that the enabling/disabling of the buttons, controlled by the arduino code, seems very delayed after writing, this is probably out of sync by 1 second. Do you think that the serout1 modification will change this? Does this also mean that I have to change the seroutCS statements?
                      Thank you very much for help also.

                      Thanks and Regards,
                      William

                      Comment


                      • #12
                        Hi William.

                        When I tried to run your code and I opened the project tab is was set to COM1 so maybe youc can check that. The sreoutCS commands will be fine as they are. If your project is set to COM0 in the project tab then serout(ACK); is correct.

                        Best regards

                        Paul

                        Comment


                        • #13
                          Hi William,

                          It may be an idea to try the genieArduino Beta library to see if this makes a difference.

                          You can find it here

                          https://github.com/4dsystems/ViSi-Ge...o-Library-BETA

                          Best regards

                          Paul

                          Comment


                          • #14
                            Hey Paul,

                            After trying this, it all seems to work fine. The only thing that I experienced is that the Beta library will only run on genuine arduino boards. The library does not work on the Sainsmart equivalent of the board. I'm not too sure what the difference is between the two but the issue now seems to be resolved.

                            Regards,
                            William

                            Comment


                            • #15
                              Hi William,

                              I'm glad the beta version of the library works better and solved your problem.
                              Regarding your issue when using the beta library to equivalent boards you mentioned, it would be best to open a new forum topic for it if you need to.

                              I'll be closing this topic now.

                              Regards,
                              Juniel Cruz

                              Comment

                              Working...
                              X