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 scroll text message

Add Magnifier png to library
Add background image to library
Add font file to library

Create a style for image
Create a style for page
Create a release key style
Create a press key style
Create a font style with text box

Create variable for keystatus
Create variable for modified TouchX
Create variable for modified TouchY
Setup touch settings for a better smoother response

Define a page named "MainPage" with style "pageStyle"
place a down key to set variable
Place a release key to reset variable

Create text entity in top left

Create image entity


Create a loop running forever

Check status of variable and run keyfnc acccordingly

Create Keyfnc function
Calculate the offset for viewing glass
Position the image at TX, TY coordinates

After loading show the page named "pageName"

LIB(img1,"SDHC/mag2.png");
LIB(backg,"SDHC/Back.png");
LIB(asc_16,"SDHC/asc_16b.fnt");

STYLE(sTimg, Image) {curRel = CC;}
STYLE(pagestyle, Page) {back = black; image=backg;}
STYLE(sTkeyU, key) {type=touch; action=U; delay=0; currel=TL;}
STYLE(sTkeyD, key) {type=touch; action=D; delay=0; currel=TL;}
STYLE(textstyle,text){font=asc_16; col=white; currel=TL; maxLen=52;type=a; back=\\80000000; padding=3; bcol=white; width=1;}

VAR(keyD,0,U8);
VAR(TX,0,U16);
VAR(TY,0,U16);

SETUP(system ){touchsamples = 3; touchdebounce = 5; touchaccuracy = 50;}
PAGE(MainPage, pagestyle)
{
posn(0,0);
KEY(keyD1,[LOAD(keyD,1);],480,272,sTkeyD);
KEY(keyU1,[LOAD(keyD,0);],480,272,sTkeyU);
POSN(1,0);
TEXT(text1,"PNG Transparency Demo, Touch Page to Move Glass",textstyle);
POSN(396,124); IMG(imgA1,img1,sTimg);

LOOP(keymove,forever)
{
IF(keyD<>0?keyfnc);
}
}

FUNC(keyfnc)
{
CALC(TX,TOUCHX,42,"+");
CALC(TY,TOUCHY,42,"+");
POSN(TX,TY,imgA1);;
}

SHOW(MainPage);;