Announcement

Collapse
No announcement yet.

µoled 128G1h script problem

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

  • µoled 128G1h script problem

    Hello im using an oled 128 in SGC mode
    Im built an script with FAT Controller and works inside very well !
    But sorry im beginner, how to get the script on SDcard copied to start from a host controller (Raspberry pi)?
    I wanna start the script with the @P command (runscript from 4DSL Program from Memory card)

    But here im stucking

    Can you explain me the further steps ?

    Thanks Tom

  • #2


    Here is the code



    #Run(Goldelox,COM8,115200,5,Wrap)
    #include "4DScript_16bitColours.inc"

    /****************************************************************************************
    * *
    * 4D Script Sample *
    * *
    * Date: 10 May 2010 *
    * *
    * Description: Demonstates most of the uSD RAW commands in script form *
    * *
    * Requirements: ABC400.4DScrpObj and NemoOldFmt.hex (If running this *
    * from the samples folder they will be found correctly) *
    * Display with uSD card with available space, *
    * this will be OVERWRITTEN *
    * *
    * Notes: *
    * *
    ****************************************************************************************/
    $openinit
    autobaud
    clear

    InituSD
    $readCSD

    //Version(1)
    delay(1000)
    //ScreenCopyuSD(0,0,128,128,0)
    Clear
    UsdImage(0,0,128,128,16,0)
    delay(10000)
    string(3,7,1,white,"Booting.")
    delay (1000)
    string(3,7,1,white,"Booting..")
    delay (1000)
    string(3,7,1,white,"Booting...")
    delay(20000)
    //$ReaduSDImage(0,128,128,'')

    //clear

    Comment


    • #3


      If you change the environment option to 'compile' you will be able to Comp'nLoad it onto the uSD card inserted in your display.
      Mark

      Comment


      • #4


        Sure this work in Workshop 3!
        Which serial command can i use To Start the Script thats THE Main problem?
        Maybe an example for Workshop 3 Terminal World be nice
        Is ist right 40500400?
        I tried this but nothing work?

        Comment


        • #5


          You are after the 'run script' command.

          You need to include the name of your program (eg 'myprog.4ds'). Have a look at the name of the file created on the uSD card by the load process.

          Remember if the filename is a long filename you will need to find and use the short filename.

          Hmm, Maybe you need to force the filename on uSD in your program.

          Try adding

          #origin 'myprog.4ds'

          to the start of your program
          Mark

          Comment


          • #6


            okay i tried this her is script


            #Compile(Goldelox,COM8,115200,5,Wrap)
            #include "4DScript_16bitColours.inc"
            #origin "oledcompile.4ds"


            //$openinit
            autobaud
            clear

            InituSD
            //$readCSD

            //Version(1)
            delay(1000)
            //ScreenCopyuSD(0,0,128,128,0)
            Clear
            UsdImage(0,0,128,128,16,0)
            delay(10000)
            string(3,2,1,red,"Booting.")
            delay (1000)
            string(3,2,1,red,"Booting..")
            delay (1000)
            string(3,2,1,red,"Booting...")
            delay(20000)
            //$ReaduSDImage(0,128,128,'')

            //clear




            now get Failure :
            Program has destination of FAT Partition and Display does not support FAT,cannot download
            Sounds like i have to use RMPET to make a RAW Partition right?

            Comment


            • #7


              Oops, my bad, I've been thinking Picaso

              Remove the origin statement and it should load

              And then 405000000000 should run it
              Mark

              Comment


              • #8


                Thats my output from Terminal(9600) display is maybe hang up (black screen)
                and no ACK ?



                02:20:48 > 55 40 50 00 00 00 00
                02:20:49 < 06

                Comment


                • #9


                  Hmm, the documentation clearly says there will be no ACK, also some of the code appears odd, in the context it is done.

                  Here's a 'cleaner' version, with comments and a hint or two.

                  #Compile(Goldelox,COM2,9600,5,wrap)

                  #include "4DScript_16bitColours.inc"

                  //$openinit
                  //autobaud, no point in autobauding, although it doesn't actually harm anything
                  clear

                  //InituSD, we have already initted uSD otherwhise we couldn't get here, this breaks program
                  //$readCSD

                  //Version(1)
                  delay(1000)
                  //ScreenCopyuSD(0,0,128,128,0)
                  Clear
                  //UsdImage(0,0,128,128,16,0) not clear whether this is an image at this location
                  delay(10000)
                  string(3,2,1,red,"Booting.")
                  delay (1000)
                  string(3,2,1,red,"Booting..")
                  delay (1000)
                  string(3,2,1,red,"Booting...")
                  delay(20000)
                  stringG(0,0,0,0,0,0,'$') // this writes a string($) to the serial port
                  exit // always good to have an exit statement
                  Mark

                  Comment


                  • #10


                    Thanks so much it works.....Awesome!!!!
                    Works fine with your code i spend a couple of time to understand all scripting issues.
                    Thanks to MR.X from 4DLabs

                    Greetings Tom

                    Comment


                    • #11


                      How can i send 55 40 50 00 00 00 00
                      In a python Script ?

                      Or better how To send multiple hex in a String?

                      Comment


                      • #12


                        Not into Python at all, but the doco here

                        http://pyserial.sourceforge.net/pyserial_api.html#module-functions-and-attributes

                        seems to imply you could put that into an array and then use 'write'
                        Mark

                        Comment


                        • #13


                          Sude i have this at work sending a 0x55 Works?

                          I Wanne send 55 40 50 00 00 00 00


                          Ser.write("0x55")


                          But how i send 55 40 50 00 00 00 00


                          Can you give me an example ?
                          Thanks

                          Comment


                          • #14


                            Would think this would work, if a bit long winded. (wouldn't expect "0x55" to work, that would just send a string and that's not what we are after here)

                            Ser.write(0x55)
                            Ser.write(0x40)
                            Ser.write(0x50)
                            Ser.write(0x00)
                            Ser.write(0x00)
                            Ser.write(0x00)
                            Ser.write(0x00)
                            Mark

                            Comment

                            Working...
                            X