Announcement

Collapse
No announcement yet.

Small screen alt problems

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

  • Small screen alt problems

    Dear Sir/Madam,

    I've got a couple question about the screen itself where we're facing some small problems.
    What we've got is by booting the screen on after compiling and loading from the arduino, we have to press on the resetbutton on the arduinoshield for the screen to work. I'll like it to do it automatically whenever it's compiled while the resetline doesn't seem to work as intended:

    Void setup
    Code:
    pinMode(RESETLINE, OUTPUT);
    delay(1000);
    
    digitalWrite(RESETLINE, 1);
    delay(100);
    digitalWrite(RESETLINE, 0);
    delay(3500);
    Second question is about the decimals i use in the custom digits. In this case I use a number with a single digit, I have to multiply the total amount by 10 on the arduino, but i don't want it to change the value.
    For example: I want the digit to show the amount of ampere it's setting to in this case it's 10.0, but it only changes the .1 by a single value. So I need to put 100 Amps ( in arduino) to make it 10.0 on the screen, while the value is still a 100. Is there a way to fix this?


    And my final question is with an automatic sleep mode. Which I understand how sleep works but not know the timing for it. For example nothing is touched in 2 min, it's go to a random "black" form and put the brightness to 0 and when touched it goes back to form 1.

  • #2
    Hi,

    What we've got is by booting the screen on after compiling and loading from the arduino, we have to press on the resetbutton on the arduinoshield for the screen to work.
    Have you connected the AR pin to the Central pin of the 'J1' of the shield? If not, try to connect them and, load your program for the Arduino.

    Second question is about the decimals i use in the custom digits. In this case I use a number with a single digit, I have to multiply the total amount by 10 on the arduino, but i don't want it to change the value.
    I think you used was the Leddigits and not custom digits. To show numbers with decimal places using custom digits, you can use two of them that are placed between Statictext " . ". Also, Leddigits can only accept integers. So to display the 10.0 on the Leddigits properly, you have to multiply the original value by 10.

    And my final question is with an automatic sleep mode. Which I understand how sleep works but not know the timing for it
    If you are using the Workshop4 Pro, you can add some MagicCodes in your ViSi-Genie project to implement this easily. You can use the function sys_Sleep(sleepTime) function where 'sleepTime' is the sleeping period of the display. You can try the sample project attached for your reference.

    Best Regards
    Attached Files

    Comment


    • #3
      Hello Ivan,

      Have you connected the AR pin to the Central pin of the 'J1' of the shield? If not, try to connect them and, load your program for the Arduino.
      Yes it is connected with the header on J1 of the shield. The button for reset works but the problem is that I have to press on it every time when compiled instead of automatic once when loaded.


      I think you used was the Leddigits and not custom digits. To show numbers with decimal places using custom digits, you can use two of them that are placed between Statictext " . ". Also, Leddigits can only accept integers. So to display the 10.0 on the Leddigits properly, you have to multiply the original value by 10.
      That makes sense indeed, multiplying de digits by 10 seems to work. Thank you!

      But is it possible to change the digits automaticaly by using an integer up to date? So on the Serial Monitor the integer is getting changed and want the same value on te screen. For example.

      Code:
      genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0, NameOfIntThatChanges);
      If you are using the Workshop4 Pro, you can add some MagicCodes in your ViSi-Genie project to implement this easily. You can use the function sys_Sleep(sleepTime) function where 'sleepTime' is the sleeping period of the display. You can try the sample project attached for your reference.
      Is there another way by just using the Arduino itself instead of using MagicCodes?
      What I've tried by now is using a black form (3 in this case who has a screen button which brings you back to the first form by pressing win6 at this moment for testing) and dim the brightness to 0, but it won't reset when pressed once again. For example:

      Code:
       if(genie.EventIs(&Event, GENIE_REPORT_EVENT, GENIE_OBJ_WINBUTTON, 6))
      {
      genie.WriteObject(GENIE_OBJ_FORM, 0x03, true);
         {
      genie.WriteContrast(0);
         }
      }
      Last edited by Juliyano satimoen; 20 October 2021, 09:12 PM.

      Comment


      • #4
        Hi,

        Yes it is connected with the header on J1 of the shield.
        I also wanted to know what display you are using and how you connect all the jumpers in the shield. It would be helpful if you can show us a clear photo of your setup.

        But is it possible to change the digits automaticaly by using an integer up to date? So on the Serial Monitor the integer is getting changed and want the same value on te screen.
        To update Leddigits using Arduino in ViSi-Genie, you can use the 'genie.WriteObject ()' function and, your code below is correct. If you want to display the output both on the display and on the serial monitor, you need to use another serial port for the display and Arduino connection.

        What I've tried by now is using a black form (3 in this case who has a screen button which brings you back to the first form by pressing win6 at this moment for testing) and dim the brightness to 0, but it won't reset when pressed once again.
        There's no touch detect in the Genie library that you can use to turn on the display, unless you use Genie Magic such as MagicCode, MagicTouch, etc.

        Best Regards

        Comment


        • #5
          To update Leddigits using Arduino in ViSi-Genie, you can use the 'genie.WriteObject ()' function and, your code below is correct. If you want to display the output both on the display and on the serial monitor, you need to use another serial port for the display and Arduino connection.
          I know how to fix that issue. Sorry for the misunderstanding, I mistyped it. we already know that we need to put the screen that we are using (gen4-uLCD-50DCT-CLB-AR) on another serial output if we want to use both the screen and serial monitor.
          The main problem we are facing right now is that we want the values that have been read by both sensors (volt and amps) to be put on the screen. we already have the digits setup, but we don't know how to constantly refresh the screen to write the values on it.

          At the moment I have it like this so that the values will be set when I press the "oke" button.
          Code:
          if(genie.EventIs(&Event, GENIE_REPORT_EVENT, GENIE_OBJ_WINBUTTON, 4))
          {
          genie.WriteObject(GENIE_OBJ_LED_DIGITS, 2, sensa * 10);
          genie.WriteObject(GENIE_OBJ_FORM, 0x02, true);
          setv = pwmv;
          seta = pwma;
          }
          Picture of our shield (tx and rx are on serial1):

          Click image for larger version

Name:	IMG_7282.JPG
Views:	67
Size:	3.58 MB
ID:	76986
          Attached Files
          Last edited by Juliyano satimoen; 26 October 2021, 05:30 PM.

          Comment


          • #6
            Hi,

            It seems that you connect the serial port from the shield to Arduino improperly. Try to swap the TX and RX connections.

            The main problem we are facing right now is that we want the values that have been read by both sensors (volt and amps) to be put on the screen.
            You can try to put the 'genie.WriteObject(GENIE_OBJ_LED_DIGITS, 2, sensa * 10)' to in the loop function. This way, you can write the values to the Leddigits constantly.

            Best Regards

            Comment

            Working...
            X