Velleman-Kit EDU 05 Installation and user guide

H
H
Ho
o
ow
w
w-
-
-t
t
to
o
o
M
M
Ma
a
an
n
nu
u
ua
a
al
l
l
T
T
Te
e
es
s
st
t
t
P
P
Pr
r
ro
o
oc
c
ce
e
ed
d
du
u
ur
r
re
e
e

EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
2
General information
1. WHAT’S ON THE BOARD?............................................................................................................................3
2. TESTING THE BOARD ...................................................................................................................................4
3. TESTING THE COMMUNICATION WITH THE PC ........................................................................................6
Test & examples software
1. DOWNLOAD THE TEST PROGRAMS...........................................................................................................7
2. INSTALL THE TEST PROGRAMS .................................................................................................................7
3. TESTING THE TEST PROGRAMS.................................................................................................................8
3.1 T
ESTING WITH THE
G
RAPHICAL
D
EMO
..........................................................................................................8
Showing the binary value of the pressed button ......................................................................................9
3.2 T
ESTING WITH THE TEST
&
DIAGNOSE DEMO
...............................................................................................10
What we see?.........................................................................................................................................10
Adding / clearing text on the LCD-display ..............................................................................................10
Disable / Enable the Startup-demo ........................................................................................................11
HOW TO
: Programming in Visual Basic 2010
Express edition
HOW TO : PROGRAMMING IN VISUAL BASIC 2010 EXPRESS EDITION....................................................11
C
CO
ON
NT
TE
EN
NT
TS
S

EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
3
This manual teaches you how to master the USB connection with the PC.
Search for reference code on YouTube.
1. What’s on the board?
All the inputs and outputs are on the board.
G
GE
EN
NE
ER
RA
AL
L
I
IN
NF
FO
OR
RM
MA
AT
TI
IO
ON
N

EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
4
2. Testing the board
Make a connection between the board and PC using the included USB cable. The LCD will display the message
“Press button SW3 ... SW7 to show analog input values SW8 to exit”. I
n the meantime the LEDs will light up in sequence.
LD1 and LD2 are digital inputs.
Press each button and check the LCD readout to check if the board functions correctly.
Press button 1 ... 7 one after the other. When you press a button, the corresponding LED lights up, and the LCD
displays the corresponding value
Press button 1
Press button 2
Press button 3
Press this button to read the value of
potentiometer 1.
When you adjust the potentiometer, the
value on the display changes.
Potentiometer 1

EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
5
Press button 4
Press this button to read the value of
potentiometer 2.
When you adjust the potentiometer, the
value on the display changes.
Press button 5
Press this button to read the temperature in
the room from the temperature sensor.
Press button 6
This shows you the value of the
temperature dependent resistor (NTC).
The resistance of this type of resistor
varies with the temperature.
When the temperature goes up, the value
of the resistor goes down.
Press button 7
This shows you the value of the light
dependent resistor (LDR).
If you cover the resistor the value will
change. More light will decrease the value
of the resistor.
This test shows us that the board is functional. The next test will show you how to communicate with the PC.
Potentiometer 2

EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
6
3. Testing the communication with the PC
Press button “8” to start the communication with the PC. The LCD shows the message “CONNECTING”. When the
connection has succeeded, the display indicates “USB CONNECTED”.
YOU MUST PRESS BUTTON 8 TO BE ABLE TO COMMUNICATE WITH THE PC!

EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
7
We have 2 types of programs: a graphical demo and a Test & Diagnosis program.
1. Downloading the test programs
Download the software package from the EDU05 product page (www…..)
Graphical demo
Test & Diagnosis
2.
Installing the test programs
Extract the files in a folder on your drive. The folder “EDU05” and several subfolders will be created: C:\EDU05\
subfolder: \DLL\ contains the dynamic link library file EDU05.DLL. This file is required for every program, this file
must always be included. In your current projects folder, it can be handy to copy this file to your \windows\system32
folder.
\GraphicalDemo\ Contains the graphical demonstration and test program. See chapter 4.
\TestDiagnosis\Contains the test & diagnosis (numerical version) demonstration and test program.
\EDU05_VB2010_tutorial\ Step-by-step manual: how to make your first program in Visual Basic
\Examples\EDU05DemoVB_2008\ Example 1 in Visual Basic 2008
\Examples\EDU05DemoVC#_2008\ Example 1 in C#
\Examples\EDU05DemoVC_2008\ Example 1 in Visual C 2008
\Examples\EDU05Demo2VB_2008\ Example 2 in Visual Basic 2008
\Examples\EDU05Demo2VC#_2008\ Example 2 in C#
\Examples\EDU05Demo2VC_2008\ Example 2 in Visual C 2008
T
TE
ES
ST
T
&
&
E
EX
XA
AM
MP
PL
LE
ES
S
S
SO
OF
FT
TW
WA
AR
RE
E

EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
8
3. Testing the test programs
3
3.
.1
1
T
Te
es
st
ti
in
ng
g
w
wi
it
th
h
t
th
he
e
G
Gr
ra
ap
ph
hi
ic
ca
al
l
D
De
em
mo
o
The graphical demo reproduces an image of the board on your screen.
•First click the “Connect” button to connect the board with the software.
•Next, perform the same test as described in chapter 2 “Testing the board”. Because the board and the
PC communicate, you can see the exact same on your screen as while testing the board itself.
Button 1 pressed Button 2 pressed
Button 3 pressed Button 4 pressed

EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
9
Button 5 pressed Button 6 pressed
Button 7 pressed Button 8 pressed
•You can click the buttons on the screen and see the result on the board.
Remark: You need to press and hold the buttons on the board to see the result. The buttons on
the screen have a toggle function: click once to switch on, click again to switch off.
S
Sh
ho
ow
wi
in
ng
g
t
th
he
e
b
bi
in
na
ar
ry
y
v
va
al
lu
ue
e
o
of
f
t
th
he
e
p
pr
re
es
ss
se
ed
d
b
bu
ut
tt
to
on
n
When you switch on the “Show binary value of button pressed” option, the PC screen and board will
indicate the binary value of the clicked button. In the example above button 5 was clicked.
•If all tests were successful, you can disconnect the board by clicking the “Disconnect” button. Then
continue with the next test.
(testing with the test & diagnosis demo).

EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
10
3
3.
.2
2
T
Te
es
st
ti
in
ng
g
w
wi
it
th
h
t
th
he
e
t
te
es
st
t
&
&
d
di
ia
ag
gn
no
os
si
is
s
d
de
em
mo
o
Start the “Test & diagnosis” software and click the “Connect” button to connect the board with the
software.
W
Wh
ha
at
t
i
is
s
o
on
n
t
th
he
e
s
sc
cr
re
ee
en
n?
?
1 Connect and Disconnect buttons to connect/disconnect
the board with the PC via the USB cable
2 Digital in
/
output selection
Input selected: each time you push a button on the board, it is
shown on the screen
Output selected: each action you make in the software screen is
shown on the board
3
A
nalog In
The bars indicate changes in the values of the potentiometers, LDR,
NTC and temperature sensor on the board.
4PWMOut
This acts like a regulation of an output value. (1) changes the LCD
contrast, and (2) changes the LCD brightness.
5 Set All Digital / Clear All Digital
The digital is represented by the LEDs on the board.
6
Disable the Start-up demo of the board
7
Adding or erasing text on the LCD-display
A
Ad
dd
di
in
ng
g
/
/
e
er
ra
as
si
in
ng
g
t
te
ex
xt
t
o
on
n
t
th
he
e
L
LC
CD
D-
-d
di
is
sp
pl
la
ay
y
Clear the text on
the display
Type your text here Set the
position of
the text
Show the text on
the display

EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0) 11
D
Di
is
sa
ab
bl
li
in
ng
g
/
/
E
En
na
ab
bl
li
in
ng
g
t
th
he
e
S
St
ta
ar
rt
t-
-u
up
p
d
de
em
mo
o
Disable the demo:
• Switch on “Disable Startup Demo”
• Disconnect the software
• Disconnect the USB cable of the board.
When you re-connect the USB cable you’ll see that demo has been disabled.
Enable the demo:
• Connect the USB cable with the board & PC *
• Run the “Test & diagnosis” software
• Connect the software
• Switch off “Disable Startup Demo”
* Because the start-up demo is disabled, you don’t need to press button “8” on the board to start the
communication with the PC.

EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
12
STEP 1
Download and install Visual Basic 2010 Express edition.
You can download the software from here: http://www.microsoft.com/visualstudio/en-us/products/2010-
editions/visual-basic-express
STEP2
If you are not experienced in Visual Basic programming, please check these links:
Visual Basic Language Reference: http://msdn.microsoft.com/en-us/library/sh9ywfdk.aspx
Getting Started Tutorials: http://msdn.microsoft.com/en-us/library/dd492171.aspx
Visual Basic: http://msdn.microsoft.com/en-us/library/2x7h1hfk.aspx
Book "Microsoft Visual Basic 2008 Express Edition: Build a Program Now!":
http://www.microsoft.com/learning/en/us/book.aspx?ID=12282&
STEP3
Download and extract the EDU05 software package from:
http://www.velleman.eu/support/downloads/?code=EDU05
STEP4
Connect the EDU05 card and press button SW8 to select USB communication.
STEP5
Start Visual Basic 2010 Express edition.
STEP6
Click "Open Project".
HOW TO: PROGRAMMING IN
VISUAL BASIC 2010 EXPRESS
EDITION

EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
13
STEP7
Locate and select "Read_Button.sln" and click Open.
STEP8
In the Solution Explorer double-click Form1.vb to show the form editor (if not visible).

EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
14
STEP9
In the Solution Explorer click the “View Code” button to show the code editor.
STEP10
Click the “Debug” button to run the code.

EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
15
To read the status of the buttons you can use the function
ReadAllDigital().
This function returns a 32 bit integer.
The eight lowest bits of this return value represent the status of the eight buttons. If you press a button, the
corresponding bit is set to "1".
You can use Visual Basic's
And
operator to mask the other bits and check the value of an individual bit.
Example: If buttons SW1, SW2 and SW8 are pressed, the eight last bits of the value are 10000011.
In this code example the button status value is read to integer i.
Every bit is checked if it is "1" or "0". If the bit is "1", it means the corresponding switch is pressed. The text
"DOWN" is displayed for this button
.
Dim i As Integer
i = ReadAllDigital()
' check the individual bits of i to detect the pressed buttons
If (i And 1) > 0 Then Label3.Text = "SW1 = Pressed" Else Label3.Text = "SW1 = Released"
If (i And 2) > 0 Then Label4.Text = "SW2 = Pressed" Else Label4.Text = "SW2 = Released"
If (i And 4) > 0 Then Label5.Text = "SW3 = Pressed" Else Label5.Text = "SW3 = Released"
If (i And 8) > 0 Then Label6.Text = "SW4 = Pressed" Else Label6.Text = "SW4 = Released"
If (i And 16) > 0 Then Label7.Text = "SW5 = Pressed" Else Label7.Text = "SW5 = Released"
If (i And 32) > 0 Then Label8.Text = "SW6 = Pressed" Else Label8.Text = "SW6 = Released"
If (i And 64) > 0 Then Label9.Text = "SW7 = Pressed" Else Label9.Text = "SW7 = Released"
If (i And 128) > 0 Then Label10.Text = "SW8 = Pressed" Else Label10.Text = "SW8 = Released"
STEP11
When you are finished evaluating this project, you can close it. Next, open the project Set_LED to study how to turn
LEDs on and off on the EDU05 board.
Velleman NV
Legen Heirweg 33
9890 Gavere, Belgium
www.velleman.eu
Table of contents
Other Velleman-Kit Computer Hardware manuals