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 move images with buttons

Add background image to library
Add MoveImg  image to Library removing all red pixels

Create a style for page with the image as background
Create a style for the image

Create a variable for X position
Create a variable for Y position

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

Create image entity positioned at Variable XPosn, YPosn
Create Left Key that runs LeftF
Create Right Key that runs RightF
Create Up Key that runs an inline function that checks if YPosn > 56 and if so takes 10 of YPosn and then repositions the image to the new YPosn variable
Create Down Key that runs an inline function that checks if YPosn < 216 and if so adds 10 to YPosn and then repositions the image to the new YPosn variable.

Create LeftF that checks if XPosn > 180 and if so takes 10 off YPosn and then repositions the image to the new XPosn variable.
Creaye RightF that checks if XPosn < 450 and if so adds 10 to XPosn and then repositions the image to the new XPosn variable.

After loading show the page named "pageName"

LIB(background,"SDHC/bground.png");
LIB(MoveImg,"SDHC/MoveImg.bmp?back=\\ff0000");

STYLE(pageStyle,Page){image=background;}
STYLE(imageStyle,Image) {curRel=CC;}
VAR(XPosn,240,U16);
VAR(YPosn,136,U16);

PAGE(pageName, pageStyle)
{
IMG(image1,MoveImg,imageStyle,XPosn,YPosn);
KEY(LeftK,LeftF,50,30,TOUCHR,40,200);
KEY(RightK,RightF,50,30,TOUCHR,100,200);
KEY(UpK,[IF(YPosn>56?[CALC(YPosn,YPosn,10,"-");]); POSN(XPosn,YPosn,image1);;],50,30,TOUCHR,70,160);
KEY(DownK,[IF(YPosn<216?[CALC(YPosn,YPosn,10,"+");]); POSN(XPosn,YPosn,image1);;],50,30,TOUCHR,70,240);
}
FUNC(LeftF)
{
IF(XPosn>180?[CALC(XPosn,XPosn,10,"-");]);
POSN(XPosn,YPosn,image1);;
}
FUNC(RightF)
{
IF(XPosn<450?[CALC(XPosn,XPosn,10,"+");]);
POSN(XPosn,YPosn,image1);;
}
SHOW(pageName);