Announcement

Collapse
No announcement yet.

u96g2 input

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

  • u96g2 input

    So my next project is to make a Star Trek next generation tricorder.I want to use a u96g2 OLED for the video display and I want to connect 3 momentary buttons to the OLEd so when I press a button it plays a certain clip.I have read through the datasheet and figured I could use one of the IO ports and the joystick circuit diagram to connect the buttons to the OLED. Are there any tutorials or documentation aobut the coding that I would need to write . Thanks
    Carl

  • #2
    Dear Carl,

    Good Day.
    You can check the application note below which can guide you in using analog inputs for Goldelox.

    Designer or ViSi Analog and Joystick Inputs

    I hope this helps.

    Best Regards,
    Ferdinand

    Comment


    • #3
      Thanks Ferdinand.

      Comment


      • #4
        OK I got the voltage divider circuit to work and wrote some code to test it.
        What I want to do is have th button press trigger a video to start playing.The problem I see is that once the video clip starts playing I assume to onboard processor is busy and the analog input wont be read until the video has stopped playing.is that correct or is the IO pin constantly being monitored? If the IO pin is not read until the video clip is done playing then pressing a button to change the video clip wont work unless the video clip is very short.I cant find anything in the datasheets that answers this.
        Carl

        Comment


        • #5
          I tried a very simple where if a button was pressed it played a video clip, but I cant get it to work.When I ran the program it just played the video loop regardless of which button was pressed. workingbuttonswithvideo.4Dg

          Comment


          • #6
            Hi Carl,

            Good Day.

            Please check the updated attached zip file.

            Thank you.

            BR,
            Ferdinand
            Attached Files

            Comment


            • #7
              Thanks Ferdinand.I have it working now with each button press triggering a video.As I thought though whilst the video is playing the program does not progress so the buttons only work once the video clip has finished.

              Is it possible to have the code written so that a button press will interrupt the video and switch to a new clip?

              If not the other solution would be to split up the video clips into 1 second segments so the program plays a 1 second segment and then loops again to check the IO pin to see if a button was pressed.If a new button was pressed the video clip will switch.If there is no button press then the next 1 second clip would play.That would be quite cumbersome.If that is the only way to do it is there a way to have a long clip and have the software start at a certain frame.This way it could play say 30 frames,check the IO and then play another 30 frames if no button is pressed or switch to 30 frames from a new video clip if a button is pressedf. I thought I had read somewhere that you can select the start frame when playing a video clip.

              Carl

              Comment


              • #8
                I think I may have a solution using the media_videoframe function.This allows you to play a few frames of a video at a time.I could have the software play one frame and then chekc the IO pin and if no button is pressed play the next frame.If a button is pressed it will change the frame number to start a new clip.

                Comment


                • #9
                  yes that works.I used the media_videoframe function to play one frame and then read the IO pin and played the next frame.I can post the code for others to use if they want to do the same

                  Comment

                  Working...
                  X