Announcement

Collapse
No announcement yet.

Running myGenieEventHandler

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

  • #16
    actually, you SHOULD have

    Serial.begin(9600);
    Serial1.begin(200000);
    genie.Begin(Serial1);

    Comment


    • #17
      Sorry for that misunderstanding on my side.

      I changed this in my sketch and the situation is as before. I can see the first ok coming from the sketch on the serial monitor. I can see the LCD images. I can move the slider... but the LCD digits do not update or indicate the slider value.

      Thanks Tony

      Comment


      • #18
        ill update you tonight

        Comment


        • #19
          OK, please check and verify on the "Project" tab of the demo open in workshop if 200000 baud is selected. if it is not, please set it to 200000 and reupload it to the uLCD-24PTU the baud rate for a workshop sketch is in the project tab, and not related to the preferences baud. the preferences one is default for new ones, however, the demo might run at a different speed. so Projects tab MUST be 200,000 and in preference you must select COMMS PORT 1
          then upload the screen using the 4D programmer/cable.

          Then give this a try

          Code:
          #include <genieArduino.h>
          #define PICASSO_RESET_LINE     30
          Genie genie;
          
          void setup() {
            Serial.begin(115200);
            Serial1.begin(200000);
            genie.Begin(Serial1);
            genie.AttachEventHandler(myGenieEventHandler);
            pinMode(PICASSO_RESET_LINE, OUTPUT); digitalWrite(PICASSO_RESET_LINE, 1); delay(100); digitalWrite(PICASSO_RESET_LINE, 0);
            delay(3000);
            genie.WriteContrast(15);
          }
          
          
          void loop() {
            genie.DoEvents();
          }
          
          void myGenieEventHandler() {
            genieFrame Event;
            genie.DequeueEvent(&Event);
          
            if ( Event.reportObject.cmd == GENIE_REPORT_EVENT && Event.reportObject.object == GENIE_OBJ_SLIDER) {
              if (Event.reportObject.index == 0) genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0, genie.GetEventData(&Event));
            }
          
          
            if ( Event.reportObject.cmd == GENIE_REPORT_OBJ && Event.reportObject.object == GENIE_OBJ_USER_LED ) {
              if (Event.reportObject.index == 0) genie.WriteObject(GENIE_OBJ_USER_LED, 0, !genie.GetEventData(&Event));
            }
          
          
          }
          Last edited by tonton81; 7th April 2017, 10:22 AM.

          Comment


          • #20
            Hi Tony

            Your code works fine in my environment. Indeed, I had the comms speed still set to the old value. Now it's set to the right value, i.e. 200'000 bps.

            Now, I am not frustrated anymore, but rather puzzled. How should I interpret things?

            I have to think a bit about all this and still have some questions:
            - Does the current version of Workshop 4 support ViSi Genie based projects development?
            - Was the ViSi Genie example project I have picked from this thread not running at all?

            Many thanks for helping me making this ViSi Genie example working. Now I'll deal with my own project based on the knowledge I got from you.

            RGs / Mohamed

            Comment


            • #21
              the 4duino is not officially supported yet for plug&play with genie in workshop, but it will be added in future so that the users dont have to be confused about the setup as it will be done by workshop when 4duino is selected in genie environment. but you can still use it once you set it up. you do everything from now on in workshop in the upcd-24ptu section with genie environment, and program the 4duino as usual in the arduino IDE. workshop supports genie of course, and it wasnt running from this thread because this section of the forum is related to standalone displays with picasso processor, which, works if the ulcd24ptu was using default comms port 0. 4duino uses comms port 1 for display communication. so now genie will work fine because the display is talking on it's proper comms line

              Comment

              Working...
              X