New Page 1

How To Do - Example Projects

Click on the title to open the example project
Click on the How to projects above to see the basic sample code to help you create your projects quickly and efficiently.
Each "How To" has a overall description as well as a basic line by line detail of code.
You can download the project or copy the menu file to clipboard
 
Basic Entities     Basic animation     Basic functions  
Add Image   Create button   Basic math operations
Draw colour boxes   Show page - multiple pages   Math functions
Draw colour lines   Flashing text message   Create random number
Draw colour vectors   Animation with pointers   Plus and Minus
Draw colour circles   Scroll text message   Show and format Time and Date
Draw colour ellipses   Move images (TouchX, TouchY)   Save Timestamp to text file  
Draw arcs (ellipses with angle)   Move images with buttons   Password Entry Lock  
Add multiple rows text     Move images (press button)     Menu Selection  
Use pointers   Create slider      
Text Hello World   Show and hide entities   Graphs
Create Dynamic Entities     Dial needle   Create X-Bar Graph
      PNG Transparency     Create Y-Bar Graph  
Interfaces and Hardware             Trace graph from array  
Create IO Counter           Draw sinusoid graph   
External Key             Draw graph - DNA style
Use A to D converters           Draw line graph  
Send and receive data - RS232          
Keyboard Control            
           
 
 

How to save time and Date to textfile

Add background image to library
Add Background image to library
Add font file to library

Create style for keyboard page
Create style for lock page
Create a style for text

Create a variable for inputted password
Create a variable for the required password

Define a page named "PassPage" with style "pageStyleK"
Postion text entity
Create number keys that add the value to the pcode variable











Create password button to view password (test only)
Create backspace key which runs fncbsp
Create clear key that empties pcode variable
Create check password button

Create page loop running forever to update text string
Check if passord button has been pressed
Or wrong password entered

Backspace function removes one character except the password cursor type
Password check to see if entered password matches the set password if correct go to menupage else show incorrect

Define a page named "menupage" with style "pageStyle"

Create a key that goes to passpage

After loading show the page named "PassPage"

LIB(backgroundK,"SDHC/bground5.png");
LIB(backgroundL,"SDHC/bground6.png");
LIB(asc_16b,"SDHC/asc_16b.fnt");

STYLE(pageStyleK, Page) { image = backgroundK; }
STYLE(pageStyle, Page) { image = backgroundL; }
STYLE(textStyle, Text) { font=asc_16b; col=\\000d55; curRel=CC; maxrows=2; yspace=-4; }
VAR(pcode,"\\01",TXT);
VAR(passw,"\\012580",TXT);

PAGE(PassPage,pageStyleK)
{
POSN(230,70); TEXT(passtxt,"",textStyle);
POSN(150,110); KEY(key1,[LOAD(pcode,pcode,1);],35,35,TOUCH);
POSN(190,110); KEY(key2,[LOAD(pcode,pcode,2);],35,35,TOUCH);
POSN(230,110); KEY(key3,[LOAD(pcode,pcode,3);],35,35,TOUCH);
POSN(150,150); KEY(key4,[LOAD(pcode,pcode,4);],35,35,TOUCH);
POSN(190,150); KEY(key5,[LOAD(pcode,pcode,5);],35,35,TOUCH);
POSN(230,150); KEY(key6,[LOAD(pcode,pcode,6);],35,35,TOUCH);
POSN(150,190); KEY(key7,[LOAD(pcode,pcode,7);],35,35,TOUCH);
POSN(190,190); KEY(key8,[LOAD(pcode,pcode,8);],35,35,TOUCH);
POSN(230,190); KEY(key9,[LOAD(pcode,pcode,9);],35,35,TOUCH);
POSN(150,230); KEY(keyast,[LOAD(pcode,pcode,"*");],35,35,TOUCH);
POSN(190,230); KEY(key0,[LOAD(pcode,pcode,0);],35,35,TOUCH);
POSN(230,230); KEY(keyhs,[LOAD(pcode,pcode,"#");],35,35,TOUCH);
POSN(290,110); KEY(keySP,[LOAD(pcode,"2580");TEXT(passtxt,pcode);;],75,35,TOUCH);
POSN(290,150); KEY(keybs,fncbsp,75,35,TOUCH);
POSN(290,190); KEY(keydel,[LOAD(pcode,"\\01");],75,35,TOUCH);
POSN(290,230); KEY(keyOK,fncOK,75,35,TOUCH);

LOOP(lp1,forever)
{
TEXT(passtxt,pcode);
IF(pcode="2580"?[WAIT(2000);LOAD(pcode,"\\01");]);
IF(pcode="Incorrect"?[WAIT(2000);LOAD(pcode,"\\01");]);;
}
}

FUNC(fncbsp) { IF(pcode~>1?[CALC(pcode,pcode,-1,"DEL");TEXT(passtxt,pcode);;]); }
FUNC(fncOK) { IF(pcode=passw?[LOAD(pcode,"\\01");TEXT(passtxt,pcode);;SHOW(menupage);]:[LOAD(pcode,"Incorrect");TEXT(passtxt,pcode);;]); }

PAGE(menupage,pageStyle)
{
POSN(240,136); KEY(LockK,[SHOW(PassPage);],100,30,TOUCH);
}

SHOW(PassPage);