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 background image to library

Create a style for page with the image as background
Create a style for the text col-black using Ascii16 font curRel=RT

Create a text variable called TxtMsg
Create a text variable called TxtMsg2
Create U16 variable for XPos
Create U16 variable for YPos
Create U8 variable for Scroll direction

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

Create text entity to show TxtMsg var
Create text entity to show TxtMsg2 var

Create page loop

Check status of ScrllV if 0 then take 5 from XPos and YPos and then position the Text entities in new positions
If XPos =200 set ScrllV to 1
Check status of ScrllV if 1 then add 5 to XPos and YPos and then position the Text entities in new positions
If XPos =450 set ScrllV to 0
Refresh page  after 50ms

After loading show the page named "pageName"

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

STYLE(pageStyle, Page) { image = background; }
STYLE(textStyle, Text) { font=Ascii16; col=Black; curRel=RT; }
VAR(TxtMsg,"Scrolling Text Message",TXT);
VAR(TxtMsg2,"Text Message",TXT);
VAR(XPos,450,U16);
VAR(YPos,0,U16);
VAR(ScrllV,0,U8);

PAGE(pageName, pageStyle)
{
POSN(XPos,134);
TEXT(Text1,TxtMsg,textStyle);
POSN(450, YPos);
TEXT(Text2,TxtMsg2,textStyle);
LOOP(Loop1,FOREVER)
{
IF(ScrllV=0?[CALC(XPos,XPos,5,"-");POSN(XPos,134,Text1); CALC(YPos,YPos,5,"+");POSN(450,YPos,Text2);]);
IF(XPos=200?[LOAD(ScrllV,1);]);
IF(ScrllV=1?[CALC(XPos,XPos,5,"+");POSN(XPos,134,Text1); CALC(YPos,YPos,5,"-");POSN(450,YPos,Text2);]);
IF(XPos=450?[LOAD(ScrllV,0);]);
WAIT(50);;
}
}
SHOW(pageName);