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 show and format Time and Date

Add background image to library

Create a style for page with the image as background
Create a style for the text entity - font Ascii16, color black
Create a style for the date variable format with jS F Y (see RTC for more format info)
Create a style for the time variable format H:i:s (see RTC for more format info)

Define variable "TimeVar".
Define variable "DateVar".

Define interrupt "TimeL", each second triggers function "UpdateT" on CNTMILLI which is miliseconds counter and it triggers interrupt each 1000 ms.

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

Set current position to X=140 Y=122
Create Text entity which will show DateVar
Create Text entity which will show TimeVar

Create UpdateT function which is called on interupt.
Loads RTC value into TimeVar which is the formated variable
Loads RTC value into DateVar which is the formated variable
Load TimeVar and DateVar into their respective text entities and refresh.

Run UpdateT after loading page
After loading show the page named "pageName"

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

STYLE(pageStyle, Page) { image = background; }
STYLE(textStyle, Text) {font = Ascii16; col = Black; }
STYLE(dateStyle,Data) {type=text; length=30; format="jS F Y"; }
STYLE(timeStyle,Data) {type=text; length=8; format="H:i:s"; }
VAR(TimeVar,"",timeStyle);
VAR(DateVar,"",dateStyle);
INT(TimeL,CNTMILLI,UpdateT);

PAGE(pageName, pageStyle)
{
POSN(140,122);
TEXT(DateT,DateVar,textStyle);
POSN(140,150);
TEXT(TimeT,TimeVar,textStyle);
}
FUNC(UpdateT)
{
LOAD(TimeVar,RTC);
LOAD(DateVar,RTC);
TEXT(TimeT,TimeVar);
TEXT(DateT,DateVar);;
}
RUN(UpdateT);
SHOW(pageName);