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 create IO Counter

Add background image to library
Add font file to library

Create page style using background image
Create text style
Create text style using previous text style parameters
Create draw style for box

Setup IO ports so K00 and K01 are active inputs and are triggered on rising edge

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

Create text entity for K00 label
Create draw entity for K00 box
Create text entity for CNTK00 value
Create text entity for K01 label
Create draw entity for K01 box
Create text entity for CNTK01 value
Create Page loop that runs forever

Loads Text entity "Text1" with CNTK00 value
Loads Text entity "Text2" with CNTK01 value

After loading show the page named "pageName"

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

STYLE(pageStyle, Page) {image = background;}
STYLE(textStyle, Text) {font=asc_16b; col=White;}
STYLE(textStyle2, textStyle) {col=Black;}
STYLE(drawstyle, Draw) {type=Box;back=steelblue;col=White;width=2;}

SETUP(keyio) {active=\\000003;inp=\\000003;trig=\\000003;edge=\\000003;}

PAGE(pageName, pageStyle)
{
TEXT(Descr1,"K00",textStyle2,140, 100);
DRAW(box1,100,30,drawstyle,140, 136);
TEXT(Text1,"",textStyle,140, 136);
TEXT(Descr2,"K01",textStyle2,340, 100);
DRAW(box2,100,30,drawstyle,340, 136);
TEXT(Text2,"",textStyle,340, 136);
LOOP(Loop1,FOREVER)
{
TEXT(Text1,CNTK00);
TEXT(Text2,CNTK01);;
}
}
SHOW(pageName);