Announcement

Collapse
No announcement yet.

Arduino not sending (analog) data to screen

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

  • Arduino not sending (analog) data to screen

    Working on trying to reverse engineer the voltmeter project you guys made, so I can understand how to multiply that for reading different engine sensors (which all work in a similar manner, by reading voltages), and I had no luck with my project. I uploaded the files I used for both my screen and Arduino to Dropbox (out of date, removed--see below).

    Side note, I have two different voltages stored, an analog and digital. I was attempting to have a digital number on top of the regular analog one, so you can stare at the panel for more detailed numbers than just looking for a yellow/redline with the analog. The other vertical gauge is for a different test I am working on after I sort this one, another placeholder.
    Last edited by stitch2k1; 2 weeks ago.

  • #2
    Update: I got a thermocouple now, and I'm attempting a rewrite of everything. Hopefully that might clean up all the spaghetti I spilled.

    If not, I'll take that upload down and redo it with my new spaghetti code.

    Comment


    • #3
      Uploaded my revision to my Dropbox (removed), attached pictures of my wiring mess. Still not getting any results.
      Is there some sort of flag I have to make to tell this to always be turned in, as the original version had the rockerswitch (and I want mine to be on 24/7).

      Any ideas?

      Edit: Seems today is solving problems just to have them break again. Found that issue, onto another.
      Last edited by stitch2k1; 2 weeks ago.

      Comment


      • #4
        Hi,

        Can you post here your current program so we can take a look at the issue? Also, it will be best if you can specify what are the problems that you have resolved.

        Best Regards,
        Kevin

        Comment


        • #5
          Originally posted by John Kevin View Post
          Hi,

          Can you post here your current program so we can take a look at the issue? Also, it will be best if you can specify what are the problems that you have resolved.

          Best Regards,
          Kevin
          I actually solved the original problem of the thread. I forgot to start my serial port. I've since moved onto my next coding project and wiring harness to trying to read a thermocouple. Hope this isn't an issue I've hijacked my own thread, lol.

          I do now currently have an issue with (my new code and new project) understanding how to separate my screen and my Adafruit MAX31855 board to two different serial ports, as currently they are trying to hog the same, so the screen doesn't operate. (I am also running this via an Arduino Mega 2560)

          Code:
          #include<genieArduino.h>
          Genie genie;
          #include<SPI.h>
          #include"Adafruit_MAX31855.h"
          
          #define MAXDO  3
          #define MAXCS  4
          #define MAXCLK 5
          
          Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);
          
          void setup()
          {
            Serial.begin(9600);
            genie.Begin(Serial);
            while (!Serial) delay(1);
            Serial.println("MAX31855 test");
            delay(2500);
          }
          
          void loop()
          {
            Serial.print("Internal Temp - ");
            Serial.println(thermocouple.readInternal());
          
            double c= thermocouple.readCelsius();
            if (isnan(c)) {
              Serial.println("Something wrong with thermocouple!");
            } else {
              Serial.print("C = ");
              Serial.println(c);
            }
            genie.WriteObject(GENIE_OBJ_GAUGE, 0x00, t );
            genie.WriteObject(GENIE_OBJ_CUSTOM_DIGITS, 0x00, 55);
            delay(1000);
          }
          I also had an issue with my J1 when connected on the AR side, it was perpetually resetting my screen, but I believe that had to do with the ports this Adafruit code originally chose. I would like to wire a button to reset the whole system, does that have to go through the shield or can it go into Arduino directly? I currently need 12 digital pins for my project goal, and 24 digital pins off the shield for CLK and CS on this Adafruit breakout board.

          Comment


          • #6
            And to add, I think a large part of my code there is redundant as my end goal is to send the data straight to the screen, and that code is for using the serial monitor. Ideally would like to keep the code for using the serial monitor so I can keep verifying the temperature is reading correctly.

            Edit: Quick question, for anything to be read by the screen, it doesn't have to go through a pin on the shield, it can go anywhere on the host, correct?
            Last edited by stitch2k1; 2 weeks ago.

            Comment


            • #7
              Nevermind, lol. Found my solution to this. It also lets me upload without unplugging anything.

              Code:
              void setup()
              {
                Serial.begin(9600);
                while (!Serial) delay(1);
                Serial1.begin(9600);
                while (!Serial1) delay(1);
                genie.Begin(Serial1);
                Serial.println("MAX31855 test");
                delay(2500);
              }

              Comment


              • #8
                Hi,

                I also had an issue with my J1 when connected on the AR side, it was perpetually resetting my screen
                By default, pin4 of the 4D Arduino Adaptor Shield is used to reset the display. If you are using this pin, most likely it will perform a reset. Though, you have the option to reset the display using the RES pin on H2 (J1 shorts pins RES and PR).

                For more information, you can refer to this application note:
                AN-00017 ViSi Genie Connecting a 4D Display to an Arduino Host
                https://4dsystems.com.au/blog/4d-an-00017/

                I would like to wire a button to reset the whole system, does that have to go through the shield or can it go into Arduino directly?
                If you chose to short the RES and PR on J1, then you only need to add a reset routine on your Arduino code (you may also take a look at the Examples on the genieArduino library).
                When the Arduino resets, the display will also reset.
                Code:
                 #define RESETLINE 4  
                
                  pinMode(RESETLINE, OUTPUT);  // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)
                  digitalWrite(RESETLINE, 1);  // Reset the Display via D4
                  delay(100);
                  digitalWrite(RESETLINE, 0);  // unReset the Display via D4
                
                  delay (3500); //let the display start up after the reset (This is important)
                Since you are using the Arduino Mega - which has 4 hardware serial ports, you can assign which serial ports will you use on the display and the serial monitor. Which from what I see is what you did on your last post.

                I hope this helps.

                Best Regards,
                Kevin

                Comment


                • #9
                  That answers about all I had, thanks.

                  Comment


                  • John Kevin
                    John Kevin commented
                    Editing a comment
                    Hi,

                    Sure, no problem. Glad to help.

                    Best Regards,
                    Kevin
                Working...
                X