Announcement

Collapse
No announcement yet.

Workshop 4 version 4.5.0.8

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

  • Workshop 4 version 4.5.0.8

    Hi

    I did install the latest version of Workshop 4 and in my environment things seem not to work as with previous version. I am lost.
    Could someone indicate to me a simple example that shows how things work, i.e. a slider with a digit that indicates the slider value.
    My environment is 4Duino with the latest Arduino IDE and the latest version of Workshop 4.

    Maybe I do have incorrect settings under Workshop options, e.g. bad serial port of bad baud rate values.

    Many thanks.

  • #2
    Hello

    Your settings should be ok wth the 4Duino. The Serial port can be changed in the Comms tab and select the port in the right hand drop down in the Arduino comms panel. The baud rate will not need changing.

    If you are still having a problem, You could try re-doing the steps in the Quick start guide http://www.4duino.com/downloads/docs...tart-Guide.pdf

    Examples for the 4Duino can be found by clicking on File, then Examples, Select 4Duino then Extended Graphics and a list of available samples will be shown, click on any in the list and it will open in Workshop.

    I hope this helps

    Best regards

    Paul

    Comment


    • #3
      Hi

      Many thanks for the feedback.

      Here is the piece of code I am trying to make running:
      Code:
      #include <genieArduino.h>
      #define RESETLINE 30
      
      Genie genie;
      int slider_val;
      
      //===================================================================
      
      void setup() {
        // put your setup code here, to run once:
      Serial.begin(11500);
      genie.Begin(Serial);
      
      genie.AttachEventHandler (myGenieEventHandler);
      
      Serial.println("Setup..");
      pinMode(RESETLINE, OUTPUT);
      digitalWrite(RESETLINE, 1);
      delay(100);
      digitalWrite(RESETLINE, 0);
      delay(3500);
      Serial.println("ok..");
      }
      
      //===================================================================
      
      void loop() {
        // put your main code here, to run repeatedly:
        genie.DoEvents();
      }
      
      //===================================================================
      
      void myGenieEventHandler(void)
      {
        genieFrame Event;
        genie.DequeueEvent(&Event);    // Remove the next queued event from the buffer, and process it below
      
        if (Event.reportObject.cmd == GENIE_REPORT_EVENT)  {
          if (Event.reportObject.object == GENIE_OBJ_SLIDER) {             // If the Reported Message was from a User LED
            if (Event.reportObject.index == 0) {                             // If UserLed0 (Index = 0)
              slider_val =  genie.GetEventData(&Event);
              genie.WriteObject(GENIE_OBJ_LED_DIGITS,0x00, slider_val);
            }
          }
        }
      } // end of loop
      and I do have a slider Slider0 and a digit block Leddigits0. I can't get any change in the Leddigits0 display when moving the slider.

      My settings and options:

      Project @ 200000 bps
      COM port for Genie = 1 and baud rate = 200000 bps
      Serial tab means 200000 bps

      Any advice?

      Comment


      • #4
        You may be confusing 4duino code with genie code. If you want to use genie there are a few things you need to do in order to get it working on 4duino, and you will need the 4D programming cable/adaptor in order to use the display with genie

        in genie you would actually need to select uLCD-24PT as the display in workshop and program it using the 4D adaptor, and make sure preferences are set to COM1 in the genie options menu of workshop. Then the code above should be functional for you.

        otherwise start over using the original 4duino code:

        in workshop, select New, and in the scroll list select Arduino, then select 4Duino, choose your option and begin


        also, this has not been a change in last and new workshop, this is always how it's been

        Tony
        Last edited by tonton81; 20th August 2017, 07:38 AM.

        Comment


        • #5
          Dear Tony

          Sorry for not being clear enough in my question. Here it is again.

          The code indicated, i.e.
          Code:
          #include <genieArduino.h>
          #define RESETLINE 30
          
          Genie genie;
          int slider_val;
          
          //===================================================================
          
          void setup() {
            // put your setup code here, to run once:
          Serial.begin(11500);
          genie.Begin(Serial);
          
          genie.AttachEventHandler (myGenieEventHandler);
          
          Serial.println("Setup..");
          pinMode(RESETLINE, OUTPUT);
          digitalWrite(RESETLINE, 1);
          delay(100);
          digitalWrite(RESETLINE, 0);
          delay(3500);
          Serial.println("ok..");
          }
          
          //===================================================================
          
          void loop() {
            // put your main code here, to run repeatedly:
            genie.DoEvents();
          }
          
          //===================================================================
          
          void myGenieEventHandler(void)
          {
            genieFrame Event;
            genie.DequeueEvent(&Event);    // Remove the next queued event from the buffer, and process it below
          
            if (Event.reportObject.cmd == GENIE_REPORT_EVENT)  {
          
              if (Event.reportObject.object == GENIE_OBJ_SLIDER) {             // If the Reported Message was from a User LED
                if (Event.reportObject.index == 0) {                             // If UserLed0 (Index = 0)
                  //slider_val =  genie.GetEventData(&Event);
                  slider_val =  23;
                  genie.WriteObject(GENIE_OBJ_LED_DIGITS,0x00, slider_val);
                }
              }
            }
          } // end of loop
          is the one written under the Arduino IDE and that will be compiled and uploaded to the Arduino (or 4Duino if you prefer).

          As you can see from the annexed pictures, my Workshop 4 project consist of just a slider and a LED digits under the Genie environment. This project has been built and loaded to the uLCD-24PTU PICASO unit via the PICASO specific cable.

          I hope this is the way things need to be done.

          The issue is that I can get any reaction from the display when moving the slider. I mean no value change will occur on the LED digits.

          Exactly this design has been working perfectly under the previous version of Workshop 4. This is what I can't understand and that's why I am assuming I must have a wrong setting iin my configuration with the Workshop 4 upgrade.

          In the annexed pictures you have also got my Workshop 4 setting.

          Thanks for your help.

          Mohamed




          Attached Files

          Comment


          • #6
            perhaps you should look at the baud

            Code:
             Serial.begin(11500); genie.Begin(Serial);
            if you did use 200,000 in workshop, this is way off
            try to use Serial.begin(200000);

            you also should not serial print to the same serial port as the LCD. remove those lines as they will also disrupt the behaviour of the lcd

            Tony

            Comment


            • #7
              Hi Tony

              Thanks for your feedback.

              I did find out my mistake. I have forgotten to start the serial communication with the PICASO module, i.e. Serial1.begin(200000);.

              I changed my code like this:

              Code:
              Serial.begin(115200);
              Serial1.begin(200000);
              genie.Begin(Serial1);
              and now everything's ok.

              Thanks for your help.

              Mohamed

              Comment

              Working...
              X