Alert.png

Notice: This page contains information for the legacy Phidget21 Library. Phidget21 does not support VINT Phidgets, and will not support any new Phidgets. Phidget21 will be maintained until 2020. We recommend that new projects be developed against the Phidget22 Library.


Click on the 2phidget22.jpg button in the menu bar to go to the Phidget22 version of this page.

Alert.png

Difference between revisions of "Template:ExamplePseudocode"

From Phidgets Legacy Support
Jump to: navigation, search
 
Line 2: Line 2:
  
 
<div class="source">
 
<div class="source">
<font size="0">
 
 
{| class="source" style="margin-left:15px;"
 
{| class="source" style="margin-left:15px;"
  
Line 46: Line 45:
 
</font>
 
</font>
 
|}
 
|}
</font>
 
 
</div>
 
</div>

Latest revision as of 20:47, 25 April 2012

The Hello World example has this general structure so you can follow along. We also have an in-depth general introduction to writing Phidget code (like open, read data, etc), as well as the {{{3}}} for specific syntax:

// ----- Event and Other Functions -----

Create any Language-Specific Functions (exception handling)

Create General Attach, Detach, and Error Handling Functions:

On attach: Print Hello Message
On detach: Print Goodbye Message

 

{{{1}}}

// ----- Main Code -----

Create Manager Software Object
Hook Event Functions created above to Device
Open Device

Wait for 'Enter' key character input
Handle on-going attach and detach events
Print Hello and Goodbye messages
Exit upon input

Close Device

Delete Device

 

{{{2}}}