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 Line (Trace) Graph

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


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






After loading show the page named "pageName"

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

STYLE(pSt,Page){image=background;}
STYLE(gSt,DRAW){type=t;col=blue;width=3;xorigin=3;}
STYLE(bSt,DRAW){type=b;col=White;back=\\40ffffff;width=1;}
VAR(YVal,0,U16);VAR(XVal,0,U16);

PAGE(page1,pSt)
{
DRAW(graph1,420,210,gSt,240,145);
DRAW(graphb,420,210,bSt,240,145);
DRAW(graph3,400,190,gSt2,250,140);
LOOP(graph,FOREVER)
{
CALC(YVal,210,"RND");
DRAW(graph1,XVal,YVal);;
CALC(XVal,XVal,20,"+");
IF(XVal>422?[LOAD(XVal,0);RESET(graph1);]);
WAIT(100);
}
}
SHOW(page1);