Announcement

Collapse
No announcement yet.

Tiva C with uLCD- 32PTU, HELP !!!!

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

  • Tiva C with uLCD- 32PTU, HELP !!!!

    I'm test this example 4D-AN-P4010_ViSi-Genie_RGB_LED with ENERGIA of tivac, this is the ID
    But it didn't work. I need help.


    The code is this and IDE of LCD it's the same!!
    I need help.
    Thanks.

    Code:
    #include <genieArduino.h>
    
    // RGB LED control demo
    // 4D Systems
    // This Demo communicates with a 4D Systems Display, configured with ViSi-Genie.
    // The display has three sliders and a reset button, each of which was configured
    // to report a message when its status has changed.
    // The program simply waits for messages. The messages are received, queued, dequeued, then interpreted.
    // The status of a slider controls the brightness of the corresponding LED.
    // The reset button moves the slider value and sets the LED brightness level to 128.
    
    
    int RED = PF_1; // Red LED is connected to pin 9
    int GREEN = PF_3; // Green LED is connected to pin 10
    int BLUE = PF_2; // Blue LED is connected to pin 11
    
    Genie genie;
    
    void setup()
    {
      // a few options to talk to the Display, uncomment the preferred serial port and baud rate
      // Make sure that the ViSi Genie program has the same baud rate.
    
      Serial.begin(9600);
      Serial3.begin(9600);
      genie.Begin(Serial3);
    
    
      genie.AttachEventHandler(myGenieEventHandler);
    
      pinMode(RED, OUTPUT);
      digitalWrite(RED, LOW);
      pinMode(GREEN, OUTPUT);
      pinMode(BLUE, OUTPUT);
    
    
      //Reset the Display (change D4 to D2 if you have original 4D Arduino Adaptor)
      //See the app note 4D-AN-P4017-ViSi-Genie Connecting a 4D Display to an Arduino Host
      //for information if using jumper connecting wires
      pinMode(11, OUTPUT); // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)
      digitalWrite(11, LOW); // Reset the Display via D4
      delay(500);
      digitalWrite(11, HIGH); // unReset the Display via D4
      delay (3500); //let the display start up
    
    }
    
    void loop()
    {
      genie.DoEvents(); //Here the messages are received and queued.
    }
    
    
    /////////////////////////////////////////////////////////////////////
    //
    // This is the user's event handler. It is called by genieDoEvents()
    // when the following conditions are true
    //
    // The link is in an IDLE state, and
    // There is an event to handle
    //
    // See 4D-AN-P4017-ViSi-Genie Connecting a 4D Display to an Arduino Host
    // for more information
    
    void myGenieEventHandler(void)
    {
      genieFrame Event;
      genie.DequeueEvent(&amp; Event);
    
      int slider_val = 0;
    
      //If the cmd received is from a Reported Event
      if (Event.reportObject.cmd == GENIE_REPORT_EVENT)
      {
        if (Event.reportObject.object == GENIE_OBJ_WINBUTTON)// If the reported message is from a Winbutton
        {
          if (Event.reportObject.index == 0x00) // If the reported message is from Winbutton0
            genie.WriteObject(GENIE_OBJ_SLIDER, 0x00, 128); // Set Slider0 value to 128
          genie.WriteObject(GENIE_OBJ_SLIDER, 0x01, 128); // Set Slider1 value to 128
          genie.WriteObject(GENIE_OBJ_SLIDER, 0x02, 128); // Set Slider2 value to 128
          analogWrite(RED, 128); // Set red LED brightness level to 128
          analogWrite(GREEN, 128); // Set green LED brightness level to 128
          analogWrite(BLUE, 128); // Set blue LED brightness level to 128
        }
    
        else if (Event.reportObject.object == GENIE_OBJ_SLIDER) // If the Reported Message is from a slider
        {
          slider_val = (Event.reportObject.data_msb & lt; &lt; 8) + Event.reportObject.data_lsb; // data of message is stored
          // in variable slider_val
    
          if (Event.reportObject.index == 0x00) // If Reported Message is from Slider0
          { analogWrite(RED, slider_val); // Write value to red LED
            Serial.print(slider_val);
          }
          else if (Event.reportObject.index == 0x01) // If Reported Message is from Slider1
          { analogWrite(GREEN, slider_val); // Write value to green LED
            Serial.print(slider_val);
          }
          else if (Event.reportObject.index == 0x02) // If Reported Message is from Slider2
          { analogWrite(BLUE, slider_val);
            Serial.print(slider_val);
          } // Write value to blue LED
        }
      }
    }
    Attached Files

  • #2
    Hello Zeaedu

    To start with, we have no experience with a Tiva C. I had to google to find out what it was.
    It looks to be a TI board which you use the Energia IDE to make it Arduino compatible?

    It looks like you are using Serial3 to talk to the display. Have you checked the documentation of the Tiva C to ensure that Serial3 is the correct serial port you need to be using, for where you have connected the hardware?

    Can you please explain your connections.
    What is that device in your picture, on the breadboard? Its blurry so hard to see.

    Have you tried to tap into the serial lines to see if you have comms to and from the Tiva C to ensure you have the connections right?

    The Arduino Genie library has not been tested with this board, so you are a little on your own to start with sadly. We do not have the hardware to even set up a test for you.

    You said 'It doesnt work'. Can you please explain what is happening exactly. Does it compile? Do you have comms at all?

    You are going to have to provide more information, especially given this is not something we have used before.

    Regards
    James

    Comment


    • #3
      Sorry for the late, I was testing the serial port with bluetooth and It send the data, and I made a "logic level converter" to the comunication, like sparkfun.
      All compile but the tiva C EK-TM4C123GXL didn't work with the Genie library and I'm trying and modify and add Energia.h and I had the same result.
      Not work.

      I would like to solve this. thanks .

      Regards
      Eduardo
      Attached Files

      Comment


      • #4
        Please try answering all the questions James asked.

        Also, what is the board for, where does it fit into things?
        Mark

        Comment

        Working...
        X