Code compiles correctly and uploads to the screen. When I place the sd card into the screen I get "Mounting..." blinking briefly then error 15 writes to the screen.
#platform "uLCD-43PT"
#inherit "4DGL_16bitColours.fnc"
#inherit "VisualConst.inc"
#inherit "NoName1Const.inc"
var frame, degrees, XYposToDegree, x, y, posit;
func main()
// var hstrings ; // Handle to access uSD strings, uncomment if required
// var hFontx ; // Handle to access uSD fonts, uncomment if required and change n to font number
// Uncomment the following if uSD images, fonts or strings used.
putstr("Mounting...\n");
if (!(disk:=file_Mount()))
while(!(disk :=file_Mount()))
putstr("Drive not mounted...");
pause(200);
gfx_Cls();
pause(200);
wend
endif
// gfx_TransparentColour(0x0020); // uncomment if transparency required
// gfx_Transparency(ON); // uncomment if transparency required
// Knob1 1.0 generated 6/10/2014 5:07:56 PM
img_Show(hndl,iKnob1) ; // show initialy, if required
img_ClearAttributes(hndl, iKnob1, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
degrees := XYposToDegree(x-322, // x - CentreX
y-50) ; // y - centreY
if (degrees < 45) // anything in the first 'dead zone' is minvalue
degrees := 0 ;
else
if (degrees > 315) // anything in the last 'dead zone' is maxvalue
degrees := 270 ;
else
degrees -= 45 ; // offset by -baseangle
endif
endif
posit := degrees * 100 / 270 ; // convert degrees to position
img_SetWord(hndl, iKnob1, IMAGE_INDEX, posit);
img_Show(hndl, iKnob1);
// Knob2 1.0 generated 6/10/2014 5:08:06 PM
img_Show(hndl,iKnob2) ; // show initialy, if required
img_ClearAttributes(hndl, iKnob2, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
degrees := XYposToDegree(x-426, // x - CentreX
y-50) ; // y - centreY
if (degrees < 45) // anything in the first 'dead zone' is minvalue
degrees := 0 ;
else
if (degrees > 315) // anything in the last 'dead zone' is maxvalue
degrees := 270 ;
else
degrees -= 45 ; // offset by -baseangle
endif
endif
posit := degrees * 100 / 270 ; // convert degrees to position
img_SetWord(hndl, iKnob2, IMAGE_INDEX, posit);
img_Show(hndl, iKnob2);
// hFontn := file_LoadImageControl("NoName1.dan", "NoName1.gcn", 1); // Open handle to access uSD fonts, uncomment if required and change n to font number dropping a and c if > 9
// hstrings := file_Open("NoName1.txf", 'r') ; // Open handle to access uSD strings, uncomment if required
hndl := file_LoadImageControl("NoName1.dat", "NoName1.gci", 1);
// Form1 1.1 generated 6/10/2014 4:56:19 PM
// Angularmeter1 1.0 generated 6/10/2014 4:56:19 PM
img_SetWord(hndl, iAngularmeter1, IMAGE_INDEX, frame) ; // where frame is 0 to 100 (for a displayed 0 to 100)
img_Show(hndl,iAngularmeter1) ;
// Angularmeter2 1.0 generated 6/10/2014 4:56:19 PM
img_SetWord(hndl, iAngularmeter2, IMAGE_INDEX, frame) ; // where frame is 0 to 100 (for a displayed 0 to 100)
img_Show(hndl,iAngularmeter2) ;
// Thermometer1 1.0 generated 6/10/2014 4:56:19 PM
img_SetWord(hndl, iThermometer1, IMAGE_INDEX, frame) ; // where frame is 0 to 100 (for a displayed -1 to -1)
img_Show(hndl,iThermometer1) ;
gfx_Set(SCREEN_MODE,LANDSCAPE) ;
repeat
forever
endfunc
#platform "uLCD-43PT"
#inherit "4DGL_16bitColours.fnc"
#inherit "VisualConst.inc"
#inherit "NoName1Const.inc"
var frame, degrees, XYposToDegree, x, y, posit;
func main()
// var hstrings ; // Handle to access uSD strings, uncomment if required
// var hFontx ; // Handle to access uSD fonts, uncomment if required and change n to font number
// Uncomment the following if uSD images, fonts or strings used.
putstr("Mounting...\n");
if (!(disk:=file_Mount()))
while(!(disk :=file_Mount()))
putstr("Drive not mounted...");
pause(200);
gfx_Cls();
pause(200);
wend
endif
// gfx_TransparentColour(0x0020); // uncomment if transparency required
// gfx_Transparency(ON); // uncomment if transparency required
// Knob1 1.0 generated 6/10/2014 5:07:56 PM
img_Show(hndl,iKnob1) ; // show initialy, if required
img_ClearAttributes(hndl, iKnob1, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
degrees := XYposToDegree(x-322, // x - CentreX
y-50) ; // y - centreY
if (degrees < 45) // anything in the first 'dead zone' is minvalue
degrees := 0 ;
else
if (degrees > 315) // anything in the last 'dead zone' is maxvalue
degrees := 270 ;
else
degrees -= 45 ; // offset by -baseangle
endif
endif
posit := degrees * 100 / 270 ; // convert degrees to position
img_SetWord(hndl, iKnob1, IMAGE_INDEX, posit);
img_Show(hndl, iKnob1);
// Knob2 1.0 generated 6/10/2014 5:08:06 PM
img_Show(hndl,iKnob2) ; // show initialy, if required
img_ClearAttributes(hndl, iKnob2, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
degrees := XYposToDegree(x-426, // x - CentreX
y-50) ; // y - centreY
if (degrees < 45) // anything in the first 'dead zone' is minvalue
degrees := 0 ;
else
if (degrees > 315) // anything in the last 'dead zone' is maxvalue
degrees := 270 ;
else
degrees -= 45 ; // offset by -baseangle
endif
endif
posit := degrees * 100 / 270 ; // convert degrees to position
img_SetWord(hndl, iKnob2, IMAGE_INDEX, posit);
img_Show(hndl, iKnob2);
// hFontn := file_LoadImageControl("NoName1.dan", "NoName1.gcn", 1); // Open handle to access uSD fonts, uncomment if required and change n to font number dropping a and c if > 9
// hstrings := file_Open("NoName1.txf", 'r') ; // Open handle to access uSD strings, uncomment if required
hndl := file_LoadImageControl("NoName1.dat", "NoName1.gci", 1);
// Form1 1.1 generated 6/10/2014 4:56:19 PM
// Angularmeter1 1.0 generated 6/10/2014 4:56:19 PM
img_SetWord(hndl, iAngularmeter1, IMAGE_INDEX, frame) ; // where frame is 0 to 100 (for a displayed 0 to 100)
img_Show(hndl,iAngularmeter1) ;
// Angularmeter2 1.0 generated 6/10/2014 4:56:19 PM
img_SetWord(hndl, iAngularmeter2, IMAGE_INDEX, frame) ; // where frame is 0 to 100 (for a displayed 0 to 100)
img_Show(hndl,iAngularmeter2) ;
// Thermometer1 1.0 generated 6/10/2014 4:56:19 PM
img_SetWord(hndl, iThermometer1, IMAGE_INDEX, frame) ; // where frame is 0 to 100 (for a displayed -1 to -1)
img_Show(hndl,iThermometer1) ;
gfx_Set(SCREEN_MODE,LANDSCAPE) ;
repeat
forever
endfunc
Comment