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 GRAPHICAL DEMO
Showing the binary value of the pressed button ...................................................................................... 9
3.2 T
ESTING WITH THE TEST & DIAGNOSE DEMO
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
EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
Page 3
GGEENNEERRAALL IINNFFOORRMMAATTIIOONN
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.
EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
3
Page 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
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
n the meantime the LEDs will light up in sequence.
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.
4
Potentiometer 1
EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
Page 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 button 6
Potentiometer 2
Press this button to read the temperature in
the room from the temperature sensor.
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 test shows us that the board is functional. The next test will show you how to communicate with the PC.
EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
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.
5
Page 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!
6
EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
Page 7
TTEESSTT && EEXXAAMMPPLLEESS SSOOFFTTW
WAARREE
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\
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
contains the dynamic link library file EDU05.DLL. This file is required for every program, this file
\Examples\EDU05Demo2VC#_2008\ Example 2 in C#
\Examples\EDU05Demo2VC_2008\ Example 2 in Visual C 2008
EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
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)
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)
11
Page 12
HOW TO: PROGRAMMING IN
VISUAL BASIC 2010 EXPRESS
EDITION
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/2010editions/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!":
Connect the EDU05 card and press button SW8 to select USB communication.
STEP5
Start Visual Basic 2010 Express edition.
STEP6
Click "Open Project".
12
EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
Page 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)
13
Page 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.
14
EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
Page 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".
And
You can use Visual Basic's
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 AsInteger
i = ReadAllDigital()
' check the individual bits of i to detect the pressed buttonsIf (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
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
EDU05 Test procedure & programming in Visual Basic 2010 ( Version 1.0)
15
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.