Announcement

Collapse
No announcement yet.

uTOLED - 20 -G2 display (2" Transparent Intelligent OLED module, 128x160)

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

  • uTOLED - 20 -G2 display (2" Transparent Intelligent OLED module, 128x160)

    Hello Everyone,

    I have a μTOLED - 20 -G2 display (2" Transparent Intelligent OLED module, 128x160)

    At first i would like to make clear, I am dummy in programming ...

    But i have create/programming a flash bar, form one side of the screen to the other....
    Now i would like to make a continuously moving bar from one side to the other side of the screen.

    Can you help me with this, and give me some advice or a code?

    Sorry for my English, i am not a native speaker.

    Thank You,.
    Last edited by Nikoltsos; 6th October 2015, 11:36 AM.

  • #2
    Not sure exactly what you are after, but have a try of this

    Code:
    #platform "GOLDELOX"
    
    #inherit "4DGL_16bitColours.fnc"
    
    #CONST
        TOP     75
        BOTTOM  95
        SIZE    50
    #END
    
    func main()
        var w, x, d ;
        w := peekB(GFX_XMAX) ;
        repeat
            gfx_RectangleFilled(0,        TOP, x-1,  BOTTOM, BLACK) ;   // clear start
            gfx_RectangleFilled(x,        TOP, x+SIZE, BOTTOM, BLUE) ;  // draw bar
            gfx_RectangleFilled(x+SIZE+1, TOP, w,    BOTTOM, BLACK) ;   // clear end
            if (d)                                                  // if Right to left
                if (x > 0)                                          // if in from left
                    x--;                                            // move to left
                else                                                // else
                    d := 0 ;                                        // change direction
                    x++ ;                                           // and move right
                endif
            else                                                    // else (Left to right)
                if (x < w-SIZE)                                     // if right side of bar not touching right edge
                    x++ ;                                           // move to right
                else                                                // else
                    d := 1 ;                                        // change direction
                    x-- ;                                           // and move left
                endif
            endif
        forever
    
    endfunc
    Mark

    Comment


    • #3
      Thank You for your time.

      I will use it and i will give you feedback...
      Also i will write more details about the project.

      Again, Sorry for my English

      Nick

      Comment


      • #4
        EDIT:

        Hi, again...

        To be more specific I want to create, a moving rectangle...
        Something like this, but without the rotation...
        https://www.khanacademy.org/computer...72251503296512

        Thank You.
        Last edited by Nikoltsos; 7th October 2015, 04:08 AM.

        Comment


        • #5
          Originally posted by ESPsupport View Post
          Not sure exactly what you are after, but have a try of this

          Code:
          #platform "GOLDELOX"
          
          #inherit "4DGL_16bitColours.fnc"
          
          #CONST
          TOP 75
          BOTTOM 95
          SIZE 50
          #END
          
          func main()
          var w, x, d ;
          w := peekB(GFX_XMAX) ;
          repeat
          gfx_RectangleFilled(0, TOP, x-1, BOTTOM, BLACK) ; // clear start
          gfx_RectangleFilled(x, TOP, x+SIZE, BOTTOM, BLUE) ; // draw bar
          gfx_RectangleFilled(x+SIZE+1, TOP, w, BOTTOM, BLACK) ; // clear end
          if (d) // if Right to left
          if (x > 0) // if in from left
          x--; // move to left
          else // else
          d := 0 ; // change direction
          x++ ; // and move right
          endif
          else // else (Left to right)
          if (x < w-SIZE) // if right side of bar not touching right edge
          x++ ; // move to right
          else // else
          d := 1 ; // change direction
          x-- ; // and move left
          endif
          endif
          forever
          
          endfunc

          From this code i receive a static bar in the left side of the screen (Landscape Rotated,Screen Mode)...
          Probably I am doing something wrong with the coordinates of the rectangular ...

          Sorry for my English, i am not a native speaker.

          Thanks
          Last edited by Nikoltsos; 7th October 2015, 02:33 AM.

          Comment


          • #6
            Really, you need to look at the code and try and learn from it.

            Here's a start for what you are asking, it's time you pick up the manual and figure out the rest

            Code:
            #platform "GOLDELOX"
            
            #inherit "4DGL_16bitColours.fnc"
            
            #CONST
                TOP     75
                SIZE    26
                SIZED2  SIZE/2
            #END
            
            func main()
                var xp[4], yp[4], x, a, i, xo, yo ;
                gfx_ScreenMode(LANDSCAPE_R) ;
                repeat
                    xo := x+SIZED2 ;
                    yo := TOP+SIZED2 ;
                    gfx_MoveTo(xo,yo) ;
                    for (i := 0 ; i < 4; i++)
                        xp[i] := xo ;
                        yp[i] := yo ;
                        gfx_OrbitInit(&xp[i], &yp[i]);
                        gfx_Orbit(a+i*90, SIZED2) ;
                    next
                    gfx_Cls() ;
                    gfx_Polygon(4, xp, yp, LIME);   // draw a polygon from a table of points
                    if (x > peekB(GFX_XMAX))
                        x := 0 ;
                    else
                        x++ ;
                    endif
                    a := a + 2 ;
                    if (a > 360) a := 0 ;
                forever
            
            endfunc
            By the way, I cannot see the issue with the first program. If I put the screenmode command in the same place as it is in the above the rectangle moves as expected
            Mark

            Comment


            • Nikoltsos
              Nikoltsos commented
              Editing a comment
              Thank You,

              It is my fist code!!!
              And as i told you I am dummy in programming...

              Thank you for your help and your time...
              When i will finish it i will post my code!!!

              Thank You again!!

          • #7
            Hi again and Happy New Year.

            After a long time a had time to work with the program.
            As you told me the program had not issues.

            Thank You again.

            Comment


            • #8
              I have few more questions:

              1) Can we see and change the code for the functions?

              2) Can we put a very long time series into the code?
              (a) what is the max length?
              (b) the goal is 15min x 60sec x 20 frames per second.

              Thank You.

              Comment


              • #9
                1) What? You mean like the code for gfx_Cls()? No, that is and internal function inside the PmmC, you can write your own functions of course.
                2) Not sure what you are asking, if you want to add videos and the like you can put them on a uSD card. Goldelox can move ~210,000 pixels per second from the uSD to the screen, so you may need to use only part of the screen to aschieve 20fps
                Mark

                Comment


                • #10
                  Thank You for your answer and your help.
                  We want to program a simple bar to move up and down on the screen we want to set the position of the bar fairly precisely at each milliseconds.
                  What is the best way to do this/an easy way to do this?

                  At the moment we have a time series of the vertical positions (for each ms we have the vertical position we want it to be in)

                  2) The time series is 15 minutes long (900,000 data points) is this reasonable?
                  3) Another option would be to program the timings the bar reaches maximum and minimum positions and then join them with some sort of smooth curve.

                  Thank You again I appreciate it.

                  Comment


                  • #11
                    Sorry, I cannot fully understand what you are asking, so I cannot provide an answer
                    Mark

                    Comment


                    • #12
                      I am so sorry for this situation,

                      As I already told you I am not native-English speaker and I have not programming experience,
                      ​So maybe this is the reason why you are not understand me.

                      Maybe the next two graphs/example will help you,

                      With the program which I already have, bar's movement looks like as chart A.
                      I want to change its movement, to looks like as the Chart B.

                      What is the best way to do this/an easy way to do this?

                      Thank You for time and I appreciate it your effort.
                      Attached Files
                      Last edited by Nikoltsos; 4th February 2016, 09:04 AM.

                      Comment


                      • #13
                        Just saying that so you can try explaining in another way.

                        Your 'chart B' looks like a bit of a sine wave between points.

                        There is a sine wave demo in File, Samples, Goldelox Designer, General Examples, GoldeloxSineWave, that could perhaps be used as a starting point, but it would need quite a bit of mathematical manipulation to get it 'right'.

                        I think you will need to learn hoe to program this yourself as I think it is a bit beyond the scope of what we can help you with.
                        Mark

                        Comment


                        • #14
                          Yes it is a sine wave.
                          Thank You so much.

                          When I will finish it, I will post the whole code.

                          Thank You again.

                          Comment


                          • #15
                            The project is continuing slowly but steady...

                            I have one more question,

                            Currently we are only able to use 9000 characters in the code. If I add a microSD card will this number increase?

                            Thank You.

                            Comment

                            Working...
                            X