Announcement

Collapse
No announcement yet.

Module type Picaso to Diablo download error

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

  • Module type Picaso to Diablo download error

    Click image for larger version

Name:	20190124_004248_HDR.jpg
Views:	1
Size:	1.43 MB
ID:	66828

    Hello,

    I would like to use a code which made for Picaso uLCD-32, to Diablo (GEN4-uLCD-24D-CLB).

    I choose the
    GEN4-uLCD-24D-CLB
    in the project menu, but while download I got the attached notice: "Program type(Picaso) does not match module type (Diablo)".

    What is missing here ?

    The code:


    #platform "Gen4-uLCD-24D-CLB"

    #inherit "VisualConst.inc"

    #inherit "NegDigitsConst.inc"

    #inherit "ledDigitsDisplay-ve.inc"

    #inherit "VisualConst.inc"

    //#inherit "spectrumConst.inc"

    func main()
    var numx, ch, numx1, ch1, numx2, ch2;
    var combuf[10] ;
    var combuf1[10] ;
    var bar, frame ;
    var i, x, y, state, n, Wbs1, Wbs3to5, WHITE, BLACK, FUCHSIA ;

    putstr("Mounting...\n");
    if (!(file_Mount()))
    while(!(file_Mount()))
    putstr("Drive not mounted...");
    pause(200);
    gfx_Cls();
    pause(200);
    wend
    endif
    hndl := file_LoadImageControl("NEGDIG~1.dat", "NEGDIG~1.gci", 1);
    Wbs1 := 0 ; // up, set to non zero (specifically 2) when down
    snd_BufSize(3);
    snd_Volume(127);
    file_PlayWAV("bl16k.wav");
    while(snd_Playing());

    gfx_Set(SCREEN_MODE,LANDSCAPE_R);
    com_SetBaud(COM0, 960); //9600 / 10
    com_SetBaud(COM1, 960); //9600 / 10
    //gfx_Set(CONTRAST,5) ;
    //txt_Set(TEXT_OPACITY, OPAQUE);

    //gfx_TransparentColour(0x0020);
    //gfx_Transparency(ON);


    // Label2 1.0 generated 04/11/2017 01:31:54
    //txt_FGcolour(WHITE) ;
    //txt_BGcolour(BLACK) ;
    gfx_MoveTo(244, 164) ;
    putstr ("Reset") ;

    pin_Set(OUTPUT, AUDIO_ENABLE);
    pin_HI(AUDIO_ENABLE);

    // Winbutton1 generated 20/12/2011 3:55:28 PM
    // img_SetWord(hndl, iWinbutton1, IMAGE_FLAGS, (img_GetWord(hndl, iWinbutton1, IMAGE_FLAGS) | I_STAYONTOP) & ~I_TOUCH_DISABLE); // set to enable touch, only need to do this once

    //serout('Test') ; // SERIAL TEST
    // to(COM0); print("serial input test:\n");
    //trout('\n');OM1); print("serial input test:\n");
    com_Init(combuf, 10, 0);
    com1_Init(combuf, 10, 0);

    img_ClearAttributes(hndl, i4Dbutton1, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
    img_SetWord(hndl, i4Dbutton1, IMAGE_INDEX, 0); // where state is 0 for up and 1 for down
    img_Show(hndl,i4Dbutton1) ;

    img_ClearAttributes(hndl, i4Dbutton2, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
    img_SetWord(hndl, i4Dbutton2, IMAGE_INDEX, 0); // where state is 0 for up and 1 for down
    img_Show(hndl,i4Dbutton2) ;

    // Image1 1.0 generated 02/11/2017 12:59:13
    img_Show(hndl,iImage1) ;

    touch_Set(TOUCH_ENABLE); // enable the touch screen
    img_Show(hndl, iLeddigits2); // show all digits at 0, only do this once
    img_Show(hndl, iLeddigits1); // show all digits at 0, only do this once

    repeat
    txt_FGcolour(WHITE) ;

    //ch := serin();
    if(com_Count() > 1)

    ch := (serin() << 8 ) + serin();
    endif
    state := touch_Get(TOUCH_STATUS); // get touchscreen status
    n := img_Touched(hndl,-1) ;

    //if (ch != -1)
    gfx_MoveTo(0,0);
    //print( [CHR] ch ); // if a key was received from PC, print its ascii value

    numx := ch; //RAND() % 999 ;

    // Leddigits1 1.0 generated 23/01/2019 23:57:34

    ledDigitsDisplay(numx, iLeddigits1+1, 128, 4, 1, 41, 1) ;


    if(com1_Count() > 1)

    ch1 := (serin1() << 8 ) + serin1();
    endif
    state := touch_Get(TOUCH_STATUS); // get touchscreen status
    n := img_Touched(hndl,-1) ;

    //if (ch != -1)
    gfx_MoveTo(0,0);
    //print( [CHR] ch ); // if a key was received from PC, print its ascii value

    numx1 := ch1; //RAND() % 999 ;


    // Leddigits2 1.0 generated 24/01/2019 00:16:58
    ledDigitsDisplay(numx, iLeddigits2+1, 131, 4, 1, 40, 1) ;



    //-----------------------------------------------------------------------------------------
    if(state == TOUCH_RELEASED) // if there's a release
    if (n == i4Dbutton1)
    if (Wbs1) Wbs1 := 0 ; else Wbs1 := 2 ; // toggle status
    img_SetWord(hndl, i4Dbutton1, IMAGE_INDEX, Wbs1); // where state is 0 for up, 1 for down, 2 for 'on' up and 3 for 'on' down
    img_Show(hndl,i4Dbutton1) ;
    print([DEC3ZB] 'a') ;
    // ASCII number written to the com port, or
    //serout(ch >> 8) ;
    serout('a') ;
    snd_BufSize(30);
    snd_Volume(30);
    file_PlayWAV("bleep1.wav");
    while(snd_Playing());
    endif

    if (n == i4Dbutton2)
    if (Wbs1) Wbs1 := 0 ; else Wbs1 := 2 ; // toggle status
    img_SetWord(hndl, i4Dbutton2, IMAGE_INDEX, Wbs1); // where state is 0 for up, 1 for down, 2 for 'on' up and 3 for 'on' down
    img_Show(hndl,i4Dbutton2) ;
    print([DEC3ZB] 'f') ;
    // ASCII number written to the com port, or
    //serout(ch >> 8) ;
    serout('f') ;
    snd_BufSize(30);
    snd_Volume(30);
    file_PlayWAV("beep.wav");
    while(snd_Playing());
    endif

    //-----------------------------------------------------------------------------------------
    if(state == TOUCH_MOVING) // if it's moving
    x := touch_Get(TOUCH_GETX);
    y := touch_Get(TOUCH_GETY);
    endif

    state := touch_Get(TOUCH_STATUS); // get touchscreen status
    n := img_Touched(hndl,-1) ;

    //-----------------------------------------------------------------------------------------
    if(state == TOUCH_PRESSED) // if there's a press
    x := touch_Get(TOUCH_GETX);
    y := touch_Get(TOUCH_GETY);
    if (n == i4Dbutton1)
    img_SetWord(hndl, i4Dbutton1, IMAGE_INDEX, Wbs1+1); // where state is 0 for up, 1 for down, 2 for 'on' up and 3 for 'on' down
    img_Show(hndl,i4Dbutton1);
    print([DEC3ZB] 's') ;
    // ASCII number written to the com port, or
    //serout(ch >> 8) ;
    serout('s') ;

    endif
    endif

    endif

    forever
    endfunc


  • #2
    Hi,

    Thank you for posting your code here.

    It should work.

    I currently checking the code that you sent and so far, I have no idea until I do not have a copy of your entire project.

    It would be great if you sent me your ViSi project to investigate on my part.

    Please open your Workshop4 application, go to File, Zip Project and send the ZIP either to the forum or to my email.
    If you do not wish to post it to the forum, please send it to my email: kayven on 4dsystems dot com dot au


    When I find the reason, I'll be back to you here soon.


    Best regards,
    Kayven
    Last edited by kayven@4d; 24th January 2019, 06:31 PM.

    Comment


    • #3
      Hello,

      You right, the code is fine. the problem was not approving the current module at the popup message, because I used before uLCD-32.

      Thanks.

      Comment

      Working...
      X