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 draw sinusoid graph

Add background image to library
Create page style
Create a trace graph style

Create variables for X Y
Create variables for XS XS2
Create variables for Col and Col2

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

Create a graphs


Create graphF



Creates a loop that runs 91 times

Calculates XS by adding random number to X
Calculates Y value by SIN the XS
Multiplies Y by 70
Adds 95 to Y

draw graph at X Y
Take 20 from Y
Add 10 to X
Draw graph at X Y
Take 8 from X

Reset X value

Run graphF function
After loading show the page named "pageName"

LIB(background,"SDHC/bground.png");

STYLE(pSt, Page) {image=background;}
STYLE(gSt,DRAW){type=trace;col=navy;width=1;}
STYLE(gSt2,DRAW){type=trace;col=navy;width=2;}
VAR(Y,0,FLT4);VAR(X,0,U16);
VAR(XS,0,U16);VAR(XS2,0,U16);
VAR(Col,\\008045,U32);VAR(Col2,\\003045,U32);

PAGE(pageName,pSt)
{
DRAW(graph1,400,190,gSt,250,140);
DRAW(graph2,400,190,gSt2,250,140);
DRAW(graph3,400,190,gSt2,250,140);
}
FUNC(graphF)
{
LOOP(Loop1,91)
{
CALC(XS,2,X,"*");
CALC(XS2,180,XS,"+");
CALC(Y,XS, "SIN" );
CALC(Y,Y,60,"*");
CALC(Y,Y,95,"+");
CALC(Col,Col,2,"+");LOAD(gSt.col,Col);
CALC(Col2,Col2,2,"+");LOAD(gSt2.col,Col2);
DRAW(graph1,X,Y);DRAW(graph2,X,Y);
CALC(Y,XS2,"SIN" );
CALC(Y,Y,60,"*");
CALC(Y,Y,100,"+");
CALC(X,X,15,"+");
DRAW(graph1,X,Y);DRAW(graph3,X,Y);
CALC(X,X,11,"-");
}
}
RUN(graphF);
SHOW(pageName);