IPST-MicroBOX Secondary Education Lab manual

Page 62

62IPST-MicroBOX [SE] Lab manual

5.4.3 ipst_in_out.h : Digital input/output port library This library file has functions for reading and sending the digital value to any digital input/output port of IPST-SE board. . This library must be included at the top of the program with the command #include as follows : #include <ipst_in_out.h> or #include <ipst.h>

Important functions of this library file are consisted of :

5.4.3.1 in Read data from the specific digital port Syntax

char in(x) Parameter x - Digital pin of IPST-SE board. It is 0 to 30. Pin 19 or 20 is NOT recommended. Return value 0 or 1 Example 5-5 char x;

// Declare x variable for keeping reading input data

x = in(16);

// Read pin 16 and store data to x variable.

5.4.3.2 out Write or send the data to the specific digital port Syntax

out(char _bit,char _dat) Parameter _bit - Set digital pin of IPST-SE board. It is 0 to 30. _dat - Set data output as 0 ot 1. Example 5-6 out(17,1);

// Out oin 17 with “1”

out(18,0);

// Out pin 18 with “0”


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.