Announcement

Collapse
No announcement yet.

Multiple Questions regarding Workshop4 and Diablo Display

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

  • Multiple Questions regarding Workshop4 and Diablo Display

    Hello,

    I've experienced another problem in the meantime when trying the Genius program for the overlay of the screen, I want it to work on hardware too after fixing the screen. I've tried to program it via Extended Graphics and Arduino but that doesn't work for some reason. Is it possible to get Arduino connected to the Genie program, and how do I do it because just compiling after the screen has been updated, but that didn't work for me. For example, I'm trying my own sample, an idea which I've found on your website, to control RGB LED via 3 different sliders. The screen is doing fine by using Genie, but I can't get it to work via Arduino to my breadboard as for the programming. So the sliders work and the LED goes on in the screen, but nothing happens on my breadboard. Do you know what the problem might be?

    Also, another question, is it possible that I have to use the Master/Slave (SPI) on another method? But if I do, I'd like to let it work with an extra cause and not using an extra microcontroller. So one Arduino program that functions with the 4D screen and from that screen also adds another function. For example: If the LED turns green through the slider, the green LED will turn on the breadboard, and as extra a dc motor is going at 255 speed. And if the LED turns red, the red LED turns on and the dc motor goes to stop. Is that even possible with just a button from the screen and using just one Arduino board?

    Greetings from Juliyano
    Last edited by Juliyano satimoen; 22 July 2021, 10:14 PM.

  • #2
    Hi,

    We are confused regarding your inquiry. Previously, you were discussing about reuploading SPE so you can use Extended Graphics. But now you're inquiry seems to be about using ViSi Genie.

    Can you tell me exactly which environment you'd want to discuss? We've moved your forum post into a separate topic since it seems most appropriate.

    If you have multiple questions about separate topics, please create separate threads with more descriptive titles instead.


    For now, I'll try to answer your questions separately

    Originally posted by Juliyano satimoen View Post
    I've tried to program it via Extended Graphics and Arduino but that doesn't work for some reason.
    If you wish to discuss this, please create a separate forum thread about Extended Graphics and the issue you've been having. When you do, we will do our best to help you out.

    Originally posted by Juliyano satimoen View Post
    Is it possible to get Arduino connected to the Genie program, and how do I do it because just compiling after the screen has been updated, but that didn't work for me. For example, I'm trying my own sample, an idea which I've found on your website, to control RGB LED via 3 different sliders. The screen is doing fine by using Genie, but I can't get it to work via Arduino to my breadboard as for the programming. So the sliders work and the LED goes on in the screen, but nothing happens on my breadboard. Do you know what the problem might be?
    You haven't really given us enough information about this. For all we know, it could be as simple as a wrong connection or a project setting. Usually, since both ViSi Genie and Extended Graphics (SPE) works via Serial connection, and given that you are having issues with both setup, it is likely that it is as simple as just a simple mistake.

    Originally posted by Juliyano satimoen View Post
    Also, another question, is it possible that I have to use the Master/Slave (SPI) on another method? But if I do, I'd like to let it work with an extra cause and not using an extra microcontroller. So one Arduino program that functions with the 4D screen and from that screen also adds another function. For example: If the LED turns green through the slider, the green LED will turn on the breadboard, and as extra a dc motor is going at 255 speed. And if the LED turns red, the red LED turns on and the dc motor goes to stop. Is that even possible with just a button from the screen and using just one Arduino board?
    If you look at the datasheet, you'll see that the display itself is cable of SPI as a master device. However, this requires programming. The good thing is that if you proceed with it, you might also not need an Arduino anymore. You can either use ViSi, which allows you to program the display from scratch, or ViSi Genie Magic, which allows you to add custom code to a ViSi Genie project.

    You might want to check the display datasheet to see what the extra GPIOs can do.


    I hope the above helps answer your questions.

    As a piece of advice, you might to stick to one environment at a time rather than jump to another whenever you encounter an issue. Also, we can help you better and with more informative discussions if you create topics per environment since it will provide us focus into one thing at a time.

    Best Regards

    Juniel Cruz

    Comment


    • #3
      Hello,

      My apologies for the confusion. To make it clearer we want to use the Screen for a project that we are currently developing right now. We want to be able to set a certain number on the screen that will set the voltage and ampere for the digital load (The project that is being developed is a box that will simulate a power supply by giving it a load via a MOSFET).

      The part that we are stuck at is how to be able to communicate the screen with the Arduino. So far, we have tried learning how to code through simple methods like YouTube (scarce information) or GitHub. But we can’t get it working after trying, the reason why wanted to fix the SPE was so that we could use the samples from Extended Graphics and see how the code has been written.

      So, if we look at how the situation is right now, we would love to use VISI instead. Because if we compare the two, we made way more progress with VISI (Genie).
      Our situation right now is that we want to make a test project before that. So what we are trying right now is to control an RGB led with the screen via buttons or sliders, which idea we've found on your website. This should be a simple enough setup to test and see if we can make a connection between the screen and Arduino.


      Greetings from Juliyano

      Comment


      • #4
        Good day,

        Originally posted by Juliyano satimoen View Post
        So, if we look at how the situation is right now, we would love to use VISI instead. Because if we compare the two, we made way more progress with VISI (Genie)
        You shouldn't confuse ViSi and ViSi Genie. If you haven't noticed I mentioned them as separate options before.

        Originally posted by Juniel Cruz View Post
        You can either use ViSi, which allows you to program the display from scratch, or ViSi Genie Magic, which allows you to add custom code to a ViSi Genie project.
        If you are writing code for the display to utilize more of its peripherals, these are your options.

        ViSi gives you full control while ViSi Genie (Magic) allows you to add more control to your project by adding code.

        For now, let's assume you want to go with ViSi Genie.

        You can find a lot of application notes applicable for this. You can find these resources here.

        Originally posted by Juliyano satimoen View Post
        So what we are trying right now is to control an RGB led with the screen via buttons or sliders, which idea we've found on your website. This should be a simple enough setup to test and see if we can make a connection between the screen and Arduino.
        For this, have you seen this application note:ViSi-Genie Arduino Danger Shield?

        There are a couple more related appnotes. Feel free to browse.

        Best Regards

        Juniel Cruz

        Comment


        • #5
          Hello,​​

          I've tried the Genie and followed this application note for basic: https://docs.4dsystems.com.au/app-note/4D-AN-00017
          On the Arduino, the programming is already complete, and I've found the file genieArduino-WS4-Demo in the /extras (which is the one used in the application note above). I've tried exactly as they say, but I still don't understand how it should connect, because compiling to the screen works, but the Arduino part is where we're stuck at. We tried to upload the Arduino later on to the screen but nothing happens as I upload it.

          I might be using the shield wrong, just for genie, I use the 4d-programming-cable directly to the breakout board via UART to the screen.
          But when using the Arduino we're taking a detour to the shield (v2.0, see image). When I'm connecting the 4d-programming-cable on the left-hand side and the jumper cables on the right-hand side towards the breakout to the screen.

          Greetings Juliyano

          Click image for larger version  Name:	IMG_6860.JPG Views:	0 Size:	2.71 MB ID:	76630

          Comment


          • James_4DSystems
            James_4DSystems commented
            Editing a comment
            Just commenting on the photo. Are you sure the adaptor is plugged into the correct pins on the arduino. It looks, offset... but it might just be the angle the photo was taken. Do the pins line up where they should be?

        • #6
          Good day!

          Based on the picture you sent, you are doing the following:
          • Powering the display externally (via H2), meaning you are connecting the programming cable here or a different power source
          • Using SoftwareSerial on pins 2 and 3, which should mean you changed the Arduino projectto suite
          • Using pin 4 for resetting the display
          If any of these doesn't match to you actual setup and code, then you should be able to see the problem.

          In any case, the connection itself is pretty straightforward. You simply need to ensure all 5pins goes to the right pins by checking the following:
          • 5V: You need to provide power to the display (ensure enough power goes into the display)
          • TX/RX: You need to ensure the Serial pins of the Arduino you are using connects to the Serial pins you are using for the ViSi Genie project. (check also your Arduino code and check the ViSi Genie project settings)
          • RST: You need to ensure the reset pin is properly connected and the correct pulse is used when resetting
          • GND: The shield takes care of this
          You also need to ensure, baudrate of the ViSi Genie project and the Arduino project matches properly.

          I hope this helps

          Juniel Cruz

          Comment


          • #7
            Hello Juniel,
            I have made no mistakes while connecting the cables from the shield to the screen. The screen itself is turning on and can be touched. While I measured the TX and RX some pulses will be sent to the Arduino. So I am sure that there is a signal being sent to the Arduino.
            The real problem I am facing right now is that I have no clue how to make the Arduino act together with the screen itself. I was hoping to make a simple setup like a led and a button on the screen and the same on the breadboard. To test out how to make the led on the screen turn on by a button on the breadboard and the led on the breadboard by the button on the screen.
            I was hoping if you could help me out with how to make the Arduino code. I still can't really grasp the way you use the libraries for 4d systems.


            Greetings Juliyano

            Comment


            • Juniel Cruz
              Juniel Cruz commented
              Editing a comment
              There are example projects in the Arduino library itself.

              You mentioned a ViSi Genie project you found. This project should work along side the Arduino project genieArduino_Demo

              Have you tried that?

            • Juliyano satimoen
              Juliyano satimoen commented
              Editing a comment
              The Genie demo itself works. But the problem that I have is that I don't know how to control something on the screen (like a LED) with a button on the breadboard.

            • Juniel Cruz
              Juniel Cruz commented
              Editing a comment
              Since you acknowledge that the demo is working, this means you should already know how to control widgets on the screen or have the resources that you can refer to.

              Getting a button input on your Arduino is exactly the same as you would do without the display. There are several examples of this on the internal and in Arduino IDE itself.

              Combine them together and you should be able to do what you need.

          • #8
            I've been trying to make the Arduino code from this pdf.
            https://docs.4dsystems.com.au/app-note/4D-AN-00010
            but it's not really working out. I did compare it with the demo in the examples.
            Code:
            #include <genieArduino.h>
            int RED = 9;
            int GREEN = 10;
            int BLUE = 11;
            
            Genie genie;
            #define RESETLINE 4
            void setup() {
            Serial.begin(19200); // Serial0 @ 19200 (19.2K) Baud
            genie.Begin(Serial); // Use Serial0 for talking to the Genie Library, and to the 4D Systems display
            genie.AttachEventHandler(myGenieEventHandler); // Attach the user function Event Handler for processing events
            
            pinMode(RED, OUTPUT);
            pinMode(GREEN, OUTPUT);
            pinMode(BLUE, OUTPUT);
            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);
            
            // Set the brightness/Contrast of the Display - (Not needed but illustrates how)
            // Most Displays use 0-15 for Brightness Control, where 0 = Display OFF, though to 15 = Max Brightness ON.
            // Some displays are more basic, 1 (or higher) = Display ON, 0 = Display OFF.
            genie.WriteContrast(10); // About 2/3 Max Brightness
            
            //Write a string to the Display to show the version of the library used
            genie.WriteStr(0, GENIE_VERSION);
            }
            void loop()
            {
            // put your main code here, to run repeatedly:
            genie.DoEvents(); // This calls the library each loop to process the queued responses from the display
            
            if (Event.reportObject.index == 0x00)
            analogWrite(RED, slider_val);
            else if (Event.reportObject.index == 0x01)
            analogWrite(GREEN, slider_val);
            else if (Event.reportObject.index == 0x02)
            analogWrite(BLUE, slider_val);
            }
            
            void myGenieEventHandler(void)
            genieFrame Event;
            genie.DequeueEvent(&Event); // Remove the next queued event from the buffer, and process it below
            int slider_val = 0;
            {
            slider_val = (Event.reportObject.data_msb << 8)
            + Event.reportObject.data_lsb;
            
            if(genie.EventIs(&Event, GENIE_REPORT_EVENT, GENIE_OBJ_WINBUTTON, 0X00))
            {
            genie.WriteObject(GENIE_OBJ_SLIDER, 0X00, 128);
            genie.WriteObject(GENIE_OBJ_SLIDER, 0X01, 128);
            genie.WriteObject(GENIE_OBJ_SLIDER, 0X02, 128);
            analogWrite(RED, 128);
            analogWrite(GEEN, 128);
            analogWrite(BLUE, 128);
            }
            if(Event.reportObject.cmd == GENIE_REPORT_EVENT)
            {
            if (Event.reportObject.object == GENIE_OBJ_WINBUTTON)
            {
            if (Event.reportObject.index == 0x00)
            genie.WriteObject(GENIE_OBJ_SLIDER, 0x00, 128);
            genie.WriteObject(GENIE_OBJ_SLIDER, 0x01, 128);
            genie.WriteObject(GENIE_OBJ_SLIDER, 0x02, 128);
            analogWrite(RED, 128);
            analogWrite(GEEN, 128);
            analogWrite(BLUE, 128);
            }
            }
            }
            Last edited by Juliyano satimoen; 18 August 2021, 08:24 PM.

            Comment


            • #9
              Hello,

              Looking at your code, it does not look right.
              If you are using that application note, why not use the code and demo that comes with it in the zip file?

              Your myGenieEventHandler function is a bit messed up, missing brackets, things in strange places etc. You are also writing to a string at the end of setup, which I am guessing you wont have if you are using the genie demo that comes with the app note?

              If you haven't seen it, download the ZIP file that is on the App Note page, as all the demo files are in there

              Click image for larger version

Name:	2021-08-19_9-24-09.jpg
Views:	93
Size:	106.0 KB
ID:	76709
              James

              Comment

              Working...
              X