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 use A to D converters

Setup ADC so ADC1 and ADC2 active with a calibration of 0.1953 and avg of 16 samples
Add background image to library

Create page style using background image
Create draw style for background box
Create draw style for slide box
Create text style for variable
Create variable for ADC1 value
Create variable for ADC2 value

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

Create a box for ADC1 background
Create a box for ADC1 slider
Create a text entity for ADC1 value
Create a box for ADC2 background
Create a box for ADC2 slider
Create a text entity for ADC2 value
Create page loop that runs forever
load the internal ADC2 variable into adc2val variable
load the variable to text entity
draw the slide box to be the adcvalue wide
load the internal ADC1 variable into adc1val variable
load the variable to text entity
draw the slide box to be the adcvalue high
refresh the page

After loading show the page named "pageName"

SETUP(ADC) {active=12;calib1=.1953;calib2=.1953;avg1=16;avg2=16;}
LIB(background,"SDHC/bground.png");

STYLE(pageStyle, Page) {image=background;}
STYLE(barstyle, Draw) {type=Box;back=White;curRel=BL;}
STYLE(boxstyle, Draw) {type=Box;col=Black;width=1;back=red;curRel=BL;}
STYLE(textStyle, Text) {font=Ascii16;col=Black;}
VAR(adc1val,0,U16);
VAR(adc2val,0,U16);

PAGE(pageName, pageStyle)
{
DRAW(Bord1,14,204,boxstyle,84, 254);
DRAW(bar1,10,200,barstyle,86, 252);
TEXT(Val1,adc1val,textStyle,120, 152);
DRAW(Bord2,204,14,boxstyle,240, 138);
DRAW(bar2,200,10,barstyle,242, 136);
TEXT(Val2,adc2val,textStyle,342, 150);
LOOP(myloop,FOREVER)
{
LOAD(adc2val, ADC2);
TEXT(Val2,adc2val);
DRAW(bar2,adc2val,10);
LOAD(adc1val,ADC1);
TEXT(Val1,adc1val);
DRAW(bar1,10,adc1val);;
}
}
SHOW(pageName);