Download presentation
Presentation is loading. Please wait.
1
Fundamentals of Embedded Microprocessors
WELCOME! Instructor: Dan Wolf (on-line classes only) 11/4/2018
2
Week #1 - The VB Demo Home Assignments: 1. MIT-103 Introduction Video
2. Do Unit 1 – The VB Demo (lab work) 3. Read the textbook sections as stated in the syllabus 4. Car flowchart - see the assignment list Lab Assignment: Unit 1 in the lab book – The VB Demo
3
Course Reading Assgnments
This class will not require the purchase or use of a traditional text book. I will instead provide internet links to both required and optional reading material. It is the student’s responsibility to keep up with the reading material. I will not be printing this material nor will I be providing downloadable copies. “If you can’t find what you want on the internet then you didn’t look hard enough!” But beware of: “It must be true, I read it on the internet.”
4
Reading Assignments
5
Mini-Assignment Register for one or more of these newsletters and turn in a copy of an newsletter with your name on it.: (select “Register” in the upper-left corner) (select “Join” in the upper-left corner) A different industry newsletter of your choosing
6
Student Information 1. Name 2. Student ID Number 3. Phone Number
4. Alternate Phone Number 5. What other programming classes have you taken? Do you have any hardware or electronics experience? What areas? 6. What is your major? Is your major a 2 or 4 year program? What is your expected graduation date? 7. Your address
7
Introductions Introduction to the Instructor Student Introductions
a) Name b) Where do you work or what is your degree? c) Why are you taking this class?
8
Administrative Information
1. Grading 2. Syllabus 3. Questions? 4. Beware of the “Wall” As a CCAC student, you are eligible for a free copy of Microsoft Office. Two important requests: Do not use cell phones during class. The PCs should only be used for active class material. Do not browse or surf during the class lecture or lab period.
9
Course Introduction This is a course that focuses on some of the high level embedded microprocessor software concepts. The course uses Visual Basic but it is not a typical Visual Basic language course. It is not a hardware course, yet it will include various hardware concepts. Visual Basic is used as the language to help teach the embedded concepts. While there are many programming concepts not covered by this course, you will get enough exposure to learn the rest yourself and/or on-the-job. A previous software, hardware or computer course would be helpful but not required.
10
What is an Embedded System?
Any dedicated microprocessor based product is an embedded system. An embedded system is a computer whose end function is not to be a computer. For example, a microwave oven contains a computer, but it's only function is to heat up food. A television contains a computer, but it's only function is to display audio and video. Internet Of Things (IOT) is a recent development involving the application of embedded microprocessors.
11
Microcontrollers Are Everywhere
12
The Internet Of Things (IOT)
13
Software & Hardware Fields
Ask me about Engineering Science versus Engineering Technology
14
IoT Development Platform
Silicon Labs Thunderboard Sense: It's billed as "feature packed development platform for battery operated IoT applications. The mobile app enables a quick proof of concept of cloud connected sensors. The multi-protocol radio combined with a broad selection of on-board sensors, make the Thunderboard Sense an excellent platform to develop and prototype a wide range of battery powered IoT applications."
15
Course Schedule – Fall 2017 This Slide has been updated! Wednesday
Week/Unit# Aug 22 1 (Intro/install) Aug 29 2 (VB Form) Sept 5 3 (Variables) Sept 12 4 (Decisions/control) Sept 19 5 (Hex) Sept 26 6 (Logicals) Oct 3 7 (Digital) Oct 10 8 Exam & Catch-up Wednesday Week/Unit# Oct 17 9 (Filtering Part#1) Oct 24 10 (Filtering Part#2) Oct 31 11 (Sensors) Nov 7 12 (Sensors continued) Nov 14 11 (Switch Debounce) Nov 21 Thanksgiving Break Nov 28 13 (Analog & Vision) Dec 5 14 Project & Catch-up Dec 12 15 – Final Exam This Slide has been updated!
16
Unit / Lab Assignments Unit1 - The VB Demo Unit2 - The VB Form
Unit3 - Variables and Constants Unit4 – Decisions and Control Formal Lab Report#1 Unit5 – Hex Data Unit6 - Logicals Unit7 - Digital I/O Ports Unit8 - Filtering Data (Part 1 of 2) Formal Lab Report#2 Unit9 - Filtering Data (Part 2 of 2) Formal Lab Report#2 Unit10 – Sensors Unit11 – Debounce Unit12 – Vision Tracking (tbd) Formal Lab Report#3
17
Maximize Your Lab Time Read the lab work prior to each class
Do not get behind in the labs You will need the entire scheduled lab time each week
18
Budgeting Your Time The college expects you to spend three home study hours for each hour in the classroom. This course will require 3 * 3 = 9 hours of home study each week. This is a technical / lab course so nine hours is a good estimate.
19
Assignment #1 Questions to ask of two other students: 1) Name
2) Degree 3) Name of Pet 4) Employment 5) What do you want to learn from this class?
20
Installation of NovaVB
See the directions in Unit #1 – The VB Demo (Method #1 on page 1-7) The latest version of Visual Basic on the Microsoft website is Visual Basic (Visual Studio Community) 2017 but we will be using Visual Studio Express 2015. Make sure you use Option #1 in Experiment #1 to install Visual Basic on your home PC.
21
Additional Advice - READ THIS!
Set Windows Explorer to show the file extensions: a) Tools | Folder Options | View b) Uncheck “Hide Extensions”
22
“Save-As” Advice - READ THIS!
Visual Basic has a “Save-As” option (like many other programs) that will allow you to save your project under a different name. Do NOT use it to save your project to a different flash or hard drive. VB will not copy all of the files and will then access the project files from BOTH locations. You will not like the result... If you want to transfer your project files to a different flash or hard drive, exit VB and then use the Windows Explorer to COPY the files.
23
Loading a VB Project There are two methods to load a VB project:
Use the Windows Explorer to Double-Left-Click on NovaVB.VBProj. (This is always preferred because the default directory will be the same as the NovaVB.VBProj file.) Start VB, select the “Recent Projects” tab, then select the NovaVB project. Do NOT click on a form file with a .VB extension!
24
Intro to Visual Basic in the Course
We will be using on-line reading material and will NOT be using a formal text book. However, you may use one of the following if you desire additional reading material: Microsoft Visual Basic 2013 Step by Step by Michael Halvorson, ISBN or Microsoft Visual Basic 2005 Step by Step by Michael Halvorson, ISBN SAMS Teach Yourself Microsoft Visual Basic .NET 2003 text by James Foxall, ISBN:
25
Flowcharting Flowcharting is a way to describe logic, a program, task, or algorithm. Other methods of describing logic are available and may be used (pseudo-code, structure diagrams, dataflow diagrams, etc.) See Table #1, Flowchart #1 and Flowchart #2 in Unit #1 – The VB Demo (within the lab book)
26
Visual Basic programs are Event Driven.
Event Driven Programs Task Driven Program - Your program continues to look at the button and will perform the task when it is pressed. Event Driven Program - Your program sleeps until the button is pressed. When the button is pressed, the operating system sends a message (event) to your program, the code awakes, and a specific function/subroutine is invoked. Visual Basic programs are Event Driven.
27
Visual Basic Demo Turn your PC on and follow your instructor throughout the demonstration. Make sure you install NovaVB to your FLASH drive. Do not install it to one of the college PCs.
28
The VB Work Screen Start Icon View Code View Designer Solution
Immediate Code/Form Properties ToolBox Solution Explorer
29
The VB Code Window
30
The VB Designer (Form) Window
31
Accessing Visual Basic Help
1. From the VB environment, click on the Help menu. 2. Click on View Help. 3. Click on Visual Studio 2015 to get to the top of the Microsoft help. Or you can simply go directly to the Microsoft’s VB Help page with this link: Note: The Microsoft help is bulky and not very friendly. Most of the time I find it easier to just Google for the non-Microsoft help.
32
Visual Basic Keyword Help
You can also select a VB keyword and press F1
33
The End
34
Week #2 - The VB Form Home Assignments:
Video: 7 New Inventions you can buy now 2. Do Unit 2– The VB Form (lab work) 2. Read the textbook sections as stated in the syllabus 3. Clock flowchart Lab Assignment: Unit 2 in the lab book – The VB Form
35
Reading Assignments
36
IOT Farming Application
37
Words of Caution See the Introduction section at the very beginning of the Lab Book and read the “Words of Caution” relating to “Clicking on a Control and Nothing Happens”. This is likely to affect you during one of the labs.
38
How much is your time worth?
11 participants in the workplace can cost the company $14.67 per minute.
39
The Form Forms - Have their own properties, events and methods. I.e. This is the graphical picture with attached controls. Controls - Have their own properties, events and methods. I.e. an Exit, OK, or Cancel button Objects - Objects have properties, respond to events, and perform methods. A combination of code & data treated as a unit.
40
Properties, Methods and Events
Properties are attributes or characteristics, like color and size that affect it's physical appearance. Methods are things you can do to an object (form or control) such as Clear, Hide, Move, Print or Show. Events are things that occur when the user does things to the object (form or control). I.e. Activate, Click, or KeyDown.
41
The VB Work Screen Start Icon View Code View Designer Solution
Immediate Code/Form Properties ToolBox Solution Explorer
42
Form Modules For each form in an application, there is a related form module (with file name extension .FRM) that contains its code. Event Procedures - These are procedures which are invoked by actions to the form controls. General Procedures - These are general purpose procedures which are called by the event procedures.
43
Standard Modules These code modules end with a .BAS extension
These contain code not related to a Specific Form or Control Function Procedures Sub Procedures (Subroutines) Property Procedures
44
Display() Subroutine ' Purpose: Method to display the form
' Input: none ' Output: none ' Date created: Apr, 2000 ' Date modified: Public Sub Display() 'this is used to display this form - it is called by frmMain Me.ShowDialog() End Sub
45
frmVBForms_Load() Subroutine
' Purpose: Loads this form ' Input: none ' Output: none ' Date created: Apr, 2000 ' Date modified: Private Sub frmVbForms_Load( ByVal eventSender As System.Object, ByVal EventArgs As System.EventArgs) Handles MyBase.Load Dim x As Integer 'put any required initialization here End Sub
46
cmdQuit_Click() Subroutine
Private Sub cmdQuit_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdQuit.Click Dim shStyle As Short Dim shResponse As Short shStyle = MsgBoxStyle.YesNo + MsgBoxStyle.Critical ' Define buttons. shResponse = MsgBox("Are you sure ?", shStyle, "MsgBox Demo") If shResponse = MsgBoxResult.Yes Then ' User chose Yes. Me.Close() '--- Unload the form End If End Sub
47
chkDemo_CheckStateChanged() Subroutine
Private Sub chkDemo_CheckStateChanged( ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles chkDemo.CheckStateChanged 'this runs when the checkbox control is clicked 'make the label text bold type lblDemo.Font = VB6.FontChangeBold(lblDemo.Font, True) End Sub
48
cmdDemo_Click() Subroutine
Private Sub cmdDemo_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdDemo.Click ' this subroutine runs when the command button control is clicked lblDemo.Text = "The VB Frmo" 'change the text on the label caption 'next, turn off the bold type on the label lblDemo.Font = VB6.FontChangeBold(lblDemo.Font, False) chkDemo.CheckState = CheckState.Unchecked 'uncheck the chk box End Sub
49
MsgBox Function Displays a message in a dialog box, waits for the user to click a button, and returns an integer indicating which button was pressed. iResponse = MsgBox(“Are you sure?”, vbYesNo, “MsgBox Demo”)
50
Accessing Visual Basic Help
1. From the VB environment, click on the Help menu. 2. Click on View Help. 3. Click on Visual Studio 2010 to get to the top of the Microsoft help. Or you can simply go directly to the Microsoft’s VB Help page with this link:
51
Visual Basic Keyword Help
You can also select a VB keyword and press F1
52
The End Thank You !
53
Week #3 - Variables and Constants
Home Assignments: 1. Do Unit 3 – Variable Types 2. Review of the Clock Flowchart (due next week) 3. Arduino Motor Demo 4. Read the textbook sections as stated in the syllabus Lab Assignment: Minimum Lab Tonight Unit 3 in the lab book – Variable Types
54
Reading Assignments
55
If you answered “Yes”, then Great!
Last week, did you… Experiment and break something? Had to backup and undo a change? Fix something that wasn’t working or was incorrect? Improve something? Ask for help from someone else? If you answered “Yes”, then Great! We WILL make mistakes and break things – this is part of the learning process!
56
Coding and Development Standards
Klingon Programming Proverbs: Specifications are for the weak and timid! Debugging? Klingons do not debug. Our software does not coddle the weak. Our users will know fear and cower before our software! Ship it! Ship it and let them flee like the dogs they are! Take a look at “Visual Basic Coding Standards” (Referenced in the lab handout and located on the course website).
57
“Save-As” Advice - READ THIS!
Visual Basic has a “Save-As” option (like many other programs) that will allow you to save your project under a different name. Do NOT use it to save your project to a different flash or hard drive. VB will not copy all of the files and will then access the project files from BOTH locations. You will not like this... If you want to transfer your project files to a different FLASH or hard drive, exit VB and then use the Windows Explorer to COPY the files.
58
Variable Types - (most common)
Local - Has scope (accessable) only to the procedure or module Public - Has scope (accessable) to all other modules Byte 0 to (whole numbers - no fractions) Boolean True or False Short -32,768 to 32,767 (whole numbers - no fractions) Integer -2,147,483,648 to 2,147,483,647 Single E-45 to E38 Date 1/1/100 to 12/31/9999 String 0 to 2 billion Object Any value
59
Variable Naming Rules Must begin with a letter (a-Z)
Be a maximum of 255 characters in length Contain only letters, numbers, and the underscore character ( _ ); spaces and punctuation characters are not allowed. Be any word except a Visual Basic reserved word, such as If, Next, End or Sub.
60
Variable Naming Standards
Byte byt bytAge Boolean b bFound Integer i iDrinking_Age Short sh shMyAge Single sng sngGallons_Unsed Object obj objCheckSum Date dtm dtmBirthDate String s sName_of_School Long lng lngMolecules Double dbl dblTolerance
61
Variables - examples Option Explicit Dim bytNbr_of_Tools as Byte
Private bytNbr_of_Tools as Byte Public iSize_of_Class as Integer Public objCar_Speed as Object Static shCar_Length as Short iCnt = 20 iCnt = iCnt + 1 iCnt = iCnt + 21 iCnt = iTemp
62
Variables - Strings Fixed-Length Strings:
Dim sName_of_Student As String * 30 Variable-Length Strings: Dim sName_of_Student As String sLastName = “Smith” sName_of_Student = “Joseph “ & “P. ” & sLastName
63
(These used to be called Variants in earlier versions of VB)
Variables - Objects Objects are bigger and slower than other variable types but can be treated as any variable type. (These used to be called Variants in earlier versions of VB) Dim objDoor_Len as Object objDoor_Len = objDoor_Len = “The door Length is “ & objDoor_Len
64
Variables – Arrays (to be covered in more detail next week)
Dim iCounters() As Integer ReDim iCounters(10) ‘11 elements from 0 to 10 iCounters(8) = 127 or Dim iCounters(10) as Integer
65
Constants “Constants” are values that are assigned when you write the software but cannot be changed when the program executes. I.e. Variables that cannot be changed at run-time. System-defined - provided by VB VB supplied constants do not conform to the “all upper-case” standard User-defined - Created with the Const statement These should always be all capital letters
66
User-Defined Constants - Examples
Public Const BUFFER_LENGTH as Integer = 1000 Private Const BUFFER_LENGTH as Integer = 1000 Const BUFFER_LENGTH as Integer = 1000 Private Const NUMBER_CARS as Single = 200 Private Const PI as Single =
67
System-Defined Constants - Examples
vbBlack &H0 Black Color vbRed &HFF Red Color vbCrLf &H0A, &H0D Carriage Return, Line Feed vbNewLine &H0A NewLine vbOkOnly 0 Display OK button vbYesNo 4 Display Yes/No Buttons vbCancel 2 Cancel response from MsgBox vbYes 6 Yes response from MsgBox vbNo 7 No response from MsgBox VB Constants do not conform to the “all upper-case” standard
68
Val() Function Returns the numeric value of the left-most characters of a string (if they represent a numeric value). The following returns the value 1678: iStreet_Integer = Val(“ Mellon Street”) The Val function stops reading the string at the first non-numeric character.
69
Abs() Function Returns the absolute value of the argument.
The absolute value of a number is its unsigned magnitude. For example, ABS(-1) and ABS(1) both return 1. iDollars_Integer = Abs( iCash_Integer)
70
Conversion Functions These convert one data type to another:
CDbl(value) - Converts a value to a double if within range Cint(value) - Converts a value to a integer if within range CShort(value) - Converts a value to a short if within range Cbyte(value) - Converts a value to a byte if within range CStr(value) - Converts a value to a string if it is numeric CSng(value) - Converts a value to a single if within range CLng(value) - Converts a value to a long if within range
71
Variable Scope Variables in Visual Basic can have the following scope:
Scope Declaration Visible in Procedure-level ‘Private’ in procedure, The procedure in which it is declared (Local) sub, or function Module-level ‘Private’ in the The entire form or code module declarations section of a form or code module (.frm, .bas) Public ‘Public’ in the Everywhere in the application (Global) declarations section of a code module (.bas)
72
Variable Scope Diagram
73
Variable Scope - Usage PUBLIC Variables, Subroutines, or Functions in Visual Basic may be accessed by other modules and/or forms: form_name.variable module.variable form_name.type.variable module_name.type.variable frmComm.MSComm1.Output = “Message” modComm.udComPort.iComPortNbr = 1 bstatus = modComm.CloseComPort(bsimulatecomm)
74
Practice Test Questions
Show the correct syntax that will: Declare a variable named shDollars that is type Short and another variable named sMessage that is type String. Assign the value 510 to the Integer variable named iDollars. Increment the value of shDollars by 15. Assign the text string “12 Going Home” to the String variable named sMessage. Concatenate the value of variable sMessage to the text string “ Sometime Soon” and assign the result to the String variable sGreeting. What is the minimum and maximum range of a Short variable?
75
Practice Test Questions
Show the correct syntax that will: Compute the absolute value of shDollars and assign the result to the Short variable named shResult. Extract the numeric part of the String variable named sGreeting (from the prior slide) and assign it to iNumber. Assign the Short value in shDollars to the Byte value in bytMoney. Display the contents of iNumber on the screen via the TextBox control named txtDisplay. What’s wrong with the next two statements? shDollars = 64000 iCount = 3.14
76
Group Exercise Start NovaVB Go to the designer view of frmVbForms
Add a Command Button, a Text box control and a Label control to the form. Give them names of your choosing. Double-Click on the command button to go to the code. Add code so that when the command button is clicked: Declare the variables: shDollars, sMessage, sGreeting, and shResult Assign the value 510 to shDollars. Increment shDollars by 15 Assign the text string “12 Going Home” to the String variable named sMessage Assign sGreeting the concatenation of sMessage plus “Sometime Soon” plus the value of shDollars. Display the value of sGreeting on the screen via the TextBox control named txtDisplay. Test and debug Write your own code to test the rest of the practice test questions.
77
You owe me a finished clock flowchart next week.
The End Don’t Forget: You owe me a finished clock flowchart next week. Thank You !
78
Week #4 - For-Next, If-Then
Home Assignments: 1. Engineering Disasters video 2. Read the textbook sections as stated in the syllabus 3. Do Unit 4 – Decision and Control 4. Traffic Light Assignment Lab Assignment: Unit 4 in the lab book - Decision and Control
79
Reading Assignments https://www.freetutes.com/learn-vb6/lesson3.html
80
Quick Comments Flowcharts should normally progress to the right and down whenever possible. Going up and/or to the left is secondary. Labs after #3 require at least one optional to get the maximum points. You can do mine or make your own up.
81
Formal Lab Report #1 (out of 3)
Formal Lab Report #1 includes Unit 4 (Decision & Control) Formal Lab Report #1 is tentatively due two weeks from now.
82
Lab Reports - An Overview
The title page should include your name, chapter# and lab title. Printouts of the programs may be referenced in the text. Discuss as many of the new lab concepts as possible. Optional work is highly encouraged and required for grades above 89%. One of the worst things to do is get behind on the labs. Additional grading details are explained in the syllabus and graded examples are located on the class website.
83
Lab Report Format See the examples on the class website.
INTRODUCTION: Provide an overview of the topics that are involved in the lab. BODY: List and discuss each experiment. Optionals should be identified. Experiment #1 Experiment #2 CONCLUSION: Summarize each new instruction or concept. PRINTOUTS: Include a printout of each program and it’s output
84
Lab Report Schedule and Grading
Lab reports are due two weeks after the last work night for that lab. I require a majority of the labs before I will grade them. I will return the graded labs to you the week after I grade them. You must inform me in advance if your lab report will be late. The first Lab Report will be on the Week 4 material.
85
Lab Report Comments Explain each of the objectives that are listed at the beginning of each lab. Conform to the grading checklists. Do not copy the lab book text – use your own words. I will provide comments if you show me your draft before the due date. Look at the examples on the class website!
86
Special Note If you have already taken a software language course and feel that you will not be challenged by tonight’s lab: 1) Quickly review tonight’s lab 2) Jump to Lab#10, Digital I/O When we get to Lab#10, you may either: Extend Lab#10 by working with new sensors or Jump ahead to Lab#12 (Switch Debounce) or Jump ahead to Lab#13 (Analog) or Something else of our choosing.
87
Words of Caution See the Introduction section at the very beginning of the Lab Book and read the “Words of Caution” relating to “Clicking on a Control and Nothing Happens”. This is likely to affect you during one of the labs.
88
Decision Statements - If…Then…Else…End If
If iCnt < 100 Then MsgBox("The value is " & iCnt) If iCnt < iLimit Then MsgBox("The value is " & iCnt) End If If AnyDate < Now Then AnyDate = Now MsgBox("Today is " & AnyDate) Else MsgBox(“It’s not yet time for you!”)
89
Decision Statements - If…Then…ElseIf…End If
If anyDate < Now Then MsgBox(“It’s not yet time for you!”) ElseIf anyDate > Now MsgBox("Today is " & anyDate) Else MsgBox("Today is Now") End If
90
Control Statements - For…Next
Dim iCount as Integer For iCount = 0 To 5 ‘this counts up from 0 to 5 txtDemo_Window.Text = iCount Wait (4) Next For iCount = 5 To 0 Step ‘this counts down from 5 to 0 Dim sngCount as Single For sngCount = 0 To 5 Step 0.5 ‘this counts up by 0.5 txtDemo_Window.Text = sngCount
91
Arrays Public iCounters(14) As Integer ' 15 elements from 0 to 14
The array named iCounters() is essentially 15 different variables named: iCounters(0), iCounters(1) … iCounters(14) Each array element may have it’s own value: iCounters(0) = 100 iCounters(1) = 50 iCounters(2) = 75 to iCounters(14) = 456
92
Initializing Arrays with the For-Next
This example assigns the value of ten to each of the 15 different array elements: Public iCounters(14) As Integer ' 15 elements from 0 to 14 For IndexY = 0 to 14 iCounters(IndexY) = 10 Next IndexY
93
Summing Arrays with the For-Next
This example accumulates the sum of each of the 15 different array elements and stores the sum in the variable named iSum: Public iCounters(14) As Integer ' 15 elements from 0 to 14 iSum = 0 For IndexX = 0 to 14 iSum = iSum + iCounters(IndexX) Next IndexX
94
Nested Loops For iNbr = 0 To 6 ‘ sort the data For iNdx = 0 To 6
If shTData(iNdx) < shTData(iNdx + 1) Then iTemp = shTData(iNdx) shTData(iNdx) = shTData(iNdx + 1) shTData(iNdx + 1) = iTemp End If Next
95
A Simple Sorting Algorithm
' this sorts the eight element integer array - shTData() For iNbr = 0 To 6 ' sort the data For iNdx = 0 To 6 If shTData(iNdx) < shTData(iNdx + 1) Then iTemp = shTData(iNdx) shTData(iNdx) = shTData(iNdx + 1) shTData(iNdx + 1) = iTemp End If Next
96
Visual Basic programs are Event Driven.
Event Driven Programs Task Driven Program - Your program continues to look at the button and will perform the task when it is pressed. Event Driven Program - Your program sleeps until the button is pressed. When the button is pressed, the operating system sends a message (event) to your program, the code awakes, and a specific function/subroutine is invoked. Visual Basic programs are Event Driven.
97
Spell & Grammar Check Reminder
Are you using MS-Word for your labs? Are you using the Spell Checker and Grammar Checker? To run: F7
98
Practice Test Questions for For-Next
Read and complete experiment #4 in Unit #4 Create a For-Next statement that will display the numbers 1 to 10 on the screen, one at a time. Modify the above program so that it displays the numbers in reverse order, from 10 to 1. Create a For-Next statement that will compute the sum of the numbers 1 to 10.
99
Practice Test Questions for If-Then
Read and complete experiment #5 in Unit #4 Create an If-Then statement that will set variable iStatus to 1 if shCount is greater than 50 and set variable iStatus to 0 if shCount is less than 50. Create a single-line If-Then statement that will set variable iStatus to 2 if shCount is equal to 50. Modify the above example so that it also displays a message on the screen if shCount is equal to 50.
100
Practice Test Questions for Arrays
Read and complete experiment #6 in Unit #4 Declare an array that is type Short that has 6 elements and that is named shPSI. Use the For-Next instruction to put the value 100 in each of the six elements defined above. Assuming the six elements in shPSI() each contain different values, compute the average value of them and displays the result on the screen.
101
Unit #4 Demo and Review Demo of Unit#4 – Can you crash this program by entering different values? Review of the subroutine named: chkAccept_CheckStateChanged that is in frmVariables.frm
102
The End
103
Week #5 - Hex and Decimal Home Assignments: 1. Do Unit 5 – Hex Data
2. Read the textbook sections as stated in the syllabus 3. Balancing Beams Assignment The Formal Lab Report#1 (Unit #4) is due next week. Lab Assignment: Unit #5 - Hex Data
104
Reading Assignments Take a look at tonight’s Servo Motor Demo Did you complete the “grading” mini-assignment?
105
IOT Product of the week: Bluetooth USB Spoon for $99
How HAPIfork Works: When you are eating too fast, HAPIfork sends you gentle vibrations and indicator lights so you are aware of when you're not eating at a pace that is optimal for your health. In an unobtrusive way, the smart fork helps you slow down without a disruption to your meal or conversation. HAPIfork monitors the following activities: The exact time you start and end time of your meal. The amount of "fork servings" taken per minute and per meal. The specific duration of each "fork serving" interval. Your overall meal duration.
106
The Microsoft Calculator
107
The Bit & Byte BIT - Either '1' or '0', the smallest number
BYTE - consists of eight bits The byte has a range of: (base 10) 00h - FFh (base 16) (base 2) Two bytes make a word There are two hex digits in a byte 1Mbyte = FFFFFh =
108
The Nibble NIBBLE - consists of four bits The nibble has a range of:
(base 10) 0h - Fh (base 16) (base 2) Two nibbles make a byte There is one hex digit in a nibble
109
The Word WORD - consists of sixteen bits The word has a range of:
(base 10) 0000h - FFFFh (base 16) (base 2) Two words make a double word There are four hex digits in a word
110
The Double Word DOUBLE WORD - consists of 32 bits
The double word has a range of: (base 10) h - FFFFFFFFh (base 16) (base 2)
111
See the appendix in the lab book
Number Conversions Decimal Base 10 Our own number system Hex Base 16 The programmers’ number system Binary Base 2 The computers’ number system We will convert to and from each of these number systems. Hex Binary Decimal See the appendix in the lab book
112
Number Base - Digit Weights
10 to the power of: 16 to the power of: 2 to the power of:
113
Explanation of the Decimal System
(base 10) 9 * 10^0 = 9 * = 6 * 10^1 = 6 * = 0 * 10^2 = 0 * = 2 * 10^3 = 2 * = 3 * 10^4 = 3 * = 30000 = (base 10)
114
Hex to Decimal Conversion
A F (base 16) F * 160 = 15 * = 6 * = 6 * = 0 * = 0 * = 2 * = 2 * = A * = 10 * = = (base 10)
115
Binary to Decimal Conversion
(base 2) 1 * 20 = 1 * = 0 * 21 = 0 * = 0 * 22 = 0 * = 1 * 23 = 1 * = 1 * 24 = 1 * = 1 * 25 = 1 * = 0 * 26 = 0 * = 1 * 27 = 1 * = = (base 10)
116
Decimal to Hex Conversion
= FF9Ah = 4096 * 15 = 163 * F 3994 = * 15 = 162 * F 154 = * 9 = 161 * 9 10 = * 10 = 160 * A
117
Decimal to Binary Conversion
28 = (base 2) = * 1 = 24 * 1 12 = * 1 = 23 * 1 4 = * 1 = 22 * 1 = * 0 = 21 * 0 = * 0 = 20 * 0
118
Binary to Hex Conversion
8 10=A = E 12 = C = A6ECh
119
Hex to Binary Conversion
D F (hex) (13) (3) (0) (15) D30Fh =
120
Hex Numbers in Visual Basic
iValue = &H ‘this assigns a 32 (base 10) to iValue The Hex() function returns a string representation of the decimal argument: sText = Hex( 32 ) ‘this assigns a “20” to sText sText = “&H” & sText ‘ now sText equals “&H20”
121
Group Practice Convert: 5E2Eh to base 10 1D26H to base 2
14971 base 10 to Hex 16892 base 10 to binary A59FH to binary base 2 to Hex base 2 to decimal
122
Using the PMD module Experiment with the Blue I/O Box
View the LEDs and observe Hex, Binary, and Decimal interpretations. Turn on LEDs 2, 5, 7. What are the Hex, Binary, and Decimal values? Set switches 1, 4, and 6 up and the remaining switches down. Predict/calculate what the resulting value will be. Command the NovaVB main screen to read the switch values. Did you predict/calculate correctly?
123
Optional Lab Experiment
Highly recommended… Create a command button on frmPractice, give it a name, create the procedure shell, and then add the following code: iInValue = frmIO_Access.Input_(DIGINPORT) iStat = frmIO_Access.Output_(DIGOUTPORT, iInValue) Test your program using the blue I/O box. It should read the value from the switches and put the same value on the LEDs. Hint: What’s missing from the above program?
124
The End Thank You !
125
1 and 1 = 1 Week #6 - Logicals Home Assignments:
1. Do Unit 6 – Logicals 2. Read the textbook sections as stated in the syllabus. 3. Lab Report #1 (unit 4) due tonight Lab Assignment: Unit #6 - Logicals Exam in the near future – Please see me if you are not comfortable with this material. 1 and 1 = 1
126
Tonights Demo: Pixy Tracking Camera
Reading Assignments c) Tonights Demo: Pixy Tracking Camera
127
The 2nd Lab Report is due Nov 7, 2018
The formal Lab Report for Units #8 and 9, Filtering is due Week #12, Nov 7, 2018.
128
Chinese Electronics: Victim of Cyberattack
In October 2016, it was reported that unidentified hackers seized control of gadgets including Xiongmai's and directed them to launch an attack that temporarily disrupted access to a host of sites, ranging from Twitter and Netflix to Amazon and Spotify, according to U.S. web security researchers. Researchers at the New York-based cybersecurity firm Flashpoint said most of the junk traffic heaped on Dyn came from internet-connected web-cameras and video-recording devices that had components made by Xiongmai. Those components had little security protection, so devices they went into became easy to exploit.
129
2017 Industrial IOT Security Survey
130
Logicals – Descriptive Methods
There are three different methods to describe the use of the logical operations. Each method will provide the same result however it is best to use the most efficient method for the given task. Truth Tables Conventional Definition Application Definition
131
Logicals - Truth Tables
AND Truth Table Input Input Output A B F 1 OR Truth Table Input Input Output A B F 1 XOR Truth Table Input Input Output A B F 1
132
Logicals – NOT Truth Table
Input Output 1
133
Logicals – Conventional Definitions
AND: If A and B are High Then F = High OR: If A or B is High Then F = High XOR: If A or B is High (but not both) Then F = High NOT: If A is High then F = Low If A is Low Then F = High
134
Logicals - AND / OR A= 1001 0110 96H B= 0011 0010 32H
A AND B= H A= H B= FH A OR B= FH If A and B are High Then F = High If A or B is High Then F = High
135
Logicals - XOR / NOT A= 1001 0110 96H B= 0000 1111 0FH
A XOR B= H A= H NOT A= H If A or B is High (but not both) Then F = High A is inverted
136
Logicals – Task-Orientated Definition
In summary: The AND operation will 'clear' bits anywhere the mask is 0 and will ignore bits wherever the mask is 1. bytIO = bytValue AND &H81 The OR operation will 'set' bits anywhere the mask is 1 and will ignore bits wherever the mask is 0. bytIO = bytValue OR $H81 The XOR operation will 'invert' bits anywhere the mask is 1 and will ignore bits whenever the mask is 0. bytIO = bytValue XOR $H81 The NOT operation will merely invert all bits. There is no mask involved with this function. bytIO = NOT bytValue
137
Logicals – Hardware Logic Diagrams
138
Logicals – Switch Equivalents
AND Gate OR Gate NOT Logic XOR Gate
139
GroupBox Control The GroupBox control allows you to group other controls and text together.
140
Option Buttons An OptionButton control displays an option that can be turned on or off. When an OptionButton (in a control array) is selected, the other OptionButtons in the control are automatically unavailable.
141
Group Assignment - Logicals
Write the code that will: Read an 8-bit digital value from the digital input port (switches). Clear bits 1 and 3 and leave the others alone. Set bits 0 and 6 and leave the others alone. Invert bits 5 and 7 and leave the others alone. Move the result to the LED output port. If bit 2 is high, display an “OK” message on the screen.
142
Lab Assignment - Logicals
Add a button and write code that will: Read an 8-bit digital value from the digital input port (switches). Clear bits 1 and 3 and leave the other bits alone. Display the value on the LEDs Add a 2nd button and write code that will: Set bits 0 and 6 and leave the others alone. Add a 3rd button and write code that will: Invert bits 5 and 7 and leave the others alone. If bit 2 is high, display an “OK” message on the screen.
143
The End
144
Week #7 - Digital I/O Home Assignments: 1. Do Unit 7 – Digital I/O
2. Read the textbook sections as stated in the syllabus. 3. Leap Year Assignment 4. Lab Report Comments 5. Exam Next Week – Take-Home tonight? Lab Assignment: Unit 7 – Digital I/O
145
Lab Report Feedback Do not copy text from either my lab or the internet. Get your ideas from the lab or internet but then use your own words to explain. Include optional experiments! Use mine or make up your own. Use my Grading Checklist! Explain the concepts: What does an If-Then do? How is it used in the code? Make sure you include enough detail so that I can see that you understand the material. If you don’t explain a concept then I can’t give you credit for it.
146
IOT Industry Example
147
College and University Fair Commons & Mezzanine Areas
Reading Assignments Tbd College and University Fair Wednesday, Oct 17, 2018 10am to 2pm B Building, 4th Floor Commons & Mezzanine Areas
148
The Embedded Muse Newsletter
Good Practical hardware and software engineering information: The Embedded Muse The Ganssle Group Editor: Jack Website: Subscribe to his newsletter:
149
Industrial Control Design Magazine
Good Practical Manufacturing Control information (control, design, motion, sensing, etc): Online Website: Free Subscriptions:
150
Bugs and Errors Syntax errors - Errors that the VB compiler catches before it executes the program. I.e. misspelled VB instructions. Run-Time errors - Logic steps, encountered during program execution, that are invalid. I.e. iByte = Cbyte( 1027 ) Logic errors - Program instructions which do not do what the programmer intended them to do. I.e. adding a check instead of deducting the check. These errors cannot be caught by the VB compiler or operating system.
151
DoEvents - Cooperative Programming
The DoEvents function returns control to the operating system so that it can process events (I.e. mouse clicks) and run other programs that are active. If your program is going to perform lengthy calculations, then you must add a call to DoEvents within the processing loop or else other programs may not get enough processing time from the CPU. DEMO
152
Delay Functions Both of these are part of the NovaVB utilities and are located in modUtilities.bas: Delays the specified number of milliseconds: mod.Utilities. Sleep( Nbr_Milli_Seconds ) Delays the specified number of 0.25 seconds: mod.Utilities. Wait( Nbr_Qtr_Seconds )
153
Digital I/O Ports Digital I/O ports allow the uP to communicate with peripheral equipment such as disk drives, keyboards, video displays, motors, switches or laser guided rockets. Digital I/O ports may be either byte or word ports. The CCAC I/O generic port is a byte port.
154
I/O Port Nomenclature Port - An electronic location typically used to allow the computer to access a hardware device. 1 = On = Set = +5Volts = High 0 = Off = Clear = 0Volts = Low
155
I/O Port Interfacing
156
I/O Port Industrial Example
157
What is an “I/O Map” ? An “I/O Map” is a table that shows the I/O specific parameters (used and not used) that are relevant to the software. Software technical documentation should ALWAYS include an I/O Map. Port# Bit# Function In/Out Bit Definition PortA Sensor#1 Count Detect Input 1=Object, 0=No Object 1 Sensor#2 Crack Detect 1=No Crack, 0=Crack 2 Sensor#3 Color Detect 0=Green 1=Red Port# Bit# Function In/Out Bit Definition PortB 7 Air Jet Output 0=Air On, 1=Air Off 6 Door Deflector 0=Green, 1=Red 5 Motor On/Off 1=On, 0=Off 0 to 4 Not used n/a
158
Bottle Sensors
159
I/O Port Instructions at CCAC South
There are two NovaVB functions to access the I/O ports: iStat = frmIO_Access.Output_(port, value) iInValue = frmIO_Access.Input_(port) There are two global constants that define the two I/O port addresses: DIGINPORT DIGOUTPORT
160
I/O Port Examples at CCAC South
iStat = frmIO_Access.Output_(DIGOUTPORT, 255) This instruction puts a 255 (FFh) to the port identified by the constant DIGOUTPORT. If the command was successful, iStat will be equal to the output value (255). If an incorrect port was identified, iStat will be set to iInValue = frmIO_Access.Input_(DIGINPORT) This instruction reads the port identified by the constant DIGINPORT. If the command was successful, iInValue will be equal to the value at the port. If you try to read an output port, iInValue will equal zero. If an incorrect port was identified, iInValue will be set to
163
PMD Electrical Overview
164
PMD Electrical Interfacing
165
PMD I/O Addresses 'these select the Digital ports
Public Const DIGOUTPORT As Short = FIRSTPORTA ' port# for digital output to the LEDs (same as above) Public Const DIGLEDPORT As Short = FIRSTPORTA ' port# for digital output to the LEDs (same as above) Public Const DIGINPORT As Short = FIRSTPORTB ' port# for digital input from the switches (same as above) Public Const DIGSWITCHPORT As Short = FIRSTPORTB ' port# for digital input from the switches (same as above) 'these select the analog Output ports Public Const ANALOUTPORT0 As Short = 'port 0 is the banana jack output #0 Public Const ANALOUTPORT1 As Short = 'port 1 is the banana jack output #1 'these select the analog Input ports Public Const ANALINJACK0 As Short = 'predefined port 0 is the input jack #0 Public Const ANALINJACK1 As Short = 'predefined port 1 is the input jack #1 Public Const ANALINPOT As Short = 'predefined port 2 is the potentiometer input Public Const ANALINLIGHT As Short = 'predefined port 3 is the light/photo sensor input Public Const ANALINPORT0 As Short = 'generic Analog input port assignments - qty=8 Public Const ANALINPORT1 As Short = 1 ' " Public Const ANALINPORT2 As Short = 2 ' " Public Const ANALINPORT3 As Short = 3 ' " Public Const ANALINPORT4 As Short = 4 ' " Public Const ANALINPORT5 As Short = 5 ' " Public Const ANALINPORT6 As Short = 6 ' " Public Const ANALINPORT7 As Short = 7 ' "
166
The End Thank You !
167
Week #8 – Exam & Lab Catch-up
Review (if requested) Teardown Tuesday_ Kwikset SmartCode Lock.pdf Exam Lab Assignment: Catch-up – Do not exit the classroom prior to 9:30pm. Spring Registration Starts Soon!
168
Week #9 - Filtering Data #1 of 2
Home Assignments: Read the textbook sections as stated in the syllabus Candy Sale Assignment Do Unit 8 – Filtering Data (part 1 of 2) Exam Review STUDENT SURVEY TONIGHT! Lab Assignment: Unit 8 - Filtering Data (part 1 of 2) - quick lab tonight
169
Rounding of Integer Variables
Assigning a fraction to an integer type variable will result in “Banker’s Rounding”. It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction. Round normally up/down but if the fractional number is 0.5 then round to the nearest EVEN number. iSum = ‘result is 3 iSum = ‘bankers rounding will result in 4 iSum = ‘result is 4 iSum = ‘result is 4 iSum = ‘bankers rounding will result in 4 iSum = ‘result is 5
170
The 2nd Lab Report is due Nov 7, 2018
The formal Lab Report for Units #8 and 9, Filtering is due Week #12, Nov 7, 2018.
171
Reading Assignments
172
IOT – “Tattoo” Skin Sensors
173
Filtering Data 1) Simple Average filter Simple to implement
Does not work well with large spikes 2) Discard Upper and Lower values and then Average the rest A little slower because of the required sort Cleanly removes spikes within the algorithm limits Can adjust the number of discards and averaging for tuning 3) More sophisticated methods are available
174
The Average Algorithm Avg = ( Value1 + Value2 + Value3 + Value4 ) / 4
For shCnt = 3 To 199 shTemp = (shData(shCnt - 3) +shData(shCnt - 2) +shData(shCnt - 1) +shData(shCnt)) / 4 shData2(shCnt) = shTemp 'save the filtered data in another array Next
175
The Average Algorithm Example
Original Raw Avg Filter 205 206 221 201 202 198 200 197 199 207 203 230 191 165 189 178
176
The Discard and Average Algorithm
1, 5, 10, 234, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65 Sorted: 1, 5, 10, 15, 20, 25, 30, 234 The middle four averaged: ( ) / 4 = 17.5 ________________________________________________ Sorted: 5, 10, 15, 20, 25, 30, 35, 234 The middle four averaged: ( ) / 4 = 22.5
177
Discard and Average Example
Original Raw Average Discard Filter 205 203 221 201 200 198 202 197 192 230 165 189 178
178
The Discard and Average Algorithm
For shCnt = 1 To 191 For shCnt2 = 0 To ' re-assign the data to a temp array shTData(shCnt2) = shData(shCnt + shCnt2) Next SortTData() ' sort the eight-element temp array, shTData() 'now average the middle four data points shTemp = (shTData(2) + shTData(3) + shTData(4) + shTData(5)) / 4 shData2(shCnt) = shTemp 'save the filtered data in another array
179
A Simple Sorting Algorithm
' this sorts the eight element integer array - shTData() For iNbr = 0 To 6 ' sort the data For snNdx = 0 To 6 If shTData(snNdx) < shTData(snNdx + 1) Then snTemp = shTData(snNdx) shTData(snNdx) = shTData(snNdx + 1) shTData(snNdx + 1) = snTemp End If Next
180
Sort Example Original Data: 10 40 20 50 30 70 60 80
Pass#1, iNbr=0: Pass#2, iNbr=1: Pass#3 iNbr=2: Pass#4 iNbr=3: Pass#5 iNbr=4: Pass#6 iNbr=5: Pass#7 iNbr=6: Pass #7 is the sorted data
181
Demonstration of the Filtering Lab Raw Data Without Filtering
182
Raw Data With Averaging Filter
183
With Average and Discard Filter
184
Math Operations + = Add iY = iY + 5 - = Subtract iY = 45 - 30
* = Multiply iY = iSum * 3 / = Divide iSum = 100 / 3 ^ = Exponential iHex = 16 ^ 3 iY = iY + 1 ‘increment by one iY = iY + 5 ‘increment by five
185
Order of Math Operations
Order of operations: Parenthesis Exponents Division and Multiplication Addition and Subtraction Examples: * 5 = 30 (50 – 4) * 5 = 230 23 – 3 * 2 = 2 (23 – 3) * 2 = 10
186
Random Numbers - RND Returns a Single variable type containing a random number. The number returned is less than 1 but greater than or equal to zero. sngDice = Rnd(1) ‘a random number >=0 and <1 sngDice = Int(6 * Rnd(1)) ‘random number between 0 & 5 sngDice = Int( 6 * Rnd(1) ) + 1 ‘random number between 1 & 6 sngDice = Int( 11 * Rnd(1) ) ‘random number between 10 & 20 sngDice = CInt( Int( ( upper – lower + 1 ) * Rnd() + lower ) )
187
Plotting with the Line Function
‘Initializes the graphics object: Dim objPicGraph As Graphics objPicGraph = picGraph.CreateGraphics ‘Scales the PictureBox control to 200 wide by 255 high: objPicGraph.ScaleTransform(picGraph.Width / 200, picGraph.Height / 255) ‘Defines the pen color as magenta Dim objLinePen As Pen objLinePen = System.Drawing.Pens.Magenta ‘Draws a line from the first position to the second position: objPicGraph.DrawLine(objLinePen, X1, Y1, X2, Y2) 'clear the plotting area on the screen objPicGraph.Clear(Color.White)
188
Plotting – Transformed Scaling
189
Plotting – Inverted Scaling
190
List Boxes List boxes present a list of choices to the user. If the number of items exceeds what can be displayed in the list box, scroll bars automatically appear on the control. The user can then scroll up and down, or left to right through the list.
191
List Box Instructions For iCnt = 0 to 15 ‘ load the ListBox
listData.Items.Add( cStr(iCnt ^ 2) ) Next listData.Items.Remove(4) ‘remove the 5th element (#4) sItem_In_List = listData.Item(2) ‘get the 3rd element (#2) iNumElements = listData.Items.Count ‘Nbr Elements listData.Sorted = True ‘sort the elements
192
Practice Test Questions
Assume that you are using the default screen mapping and have not transformed the PictureBox. Also assume that the PictureBox is 450 x 300 pixels. Show the DrawLine commands that will draw two lines from the upper-right corner to the lower-left corner and then to the lower-right corner. Assume the same size PictureBox as above but also assume that it is been Transformed to 200x255. Show the DrawLine commands that will draw the same two lines. Show how you would generate a random number between 5 and 10. Show the line of code that will compute the following: Z = 3.14 * (Y + 2)
193
Group Exercise Add a PictureBox on the Practice form and name it picGraph. Add a button named cmdDrawMyLines to the form. Add code that will draw a rectangle within the PictureBox. Hint: You will need the following code at the beginning of your subroutine: Dim objPicGraph As Graphics Dim objLinePen As Pen objPicGraph = picGraph.CreateGraphics objPicGraph.ScaleTransform(picGraph.Width / 200, picGraph.Height / 255) objLinePen = System.Drawing.Pens.Magenta Without removing the existing code, add additional code to make a different shape of your choosing to the same PictureBox. Turn in a screen print of the form and code (as well as Experiment #1).
194
The End Thank You !
195
Week #10 - Filtering Data #2 of 2
Home Assignments: 1. Read the textbook sections as stated in the syllabus. 2. Do Unit 9 – Filtering Data (part 2 of 2) Lab Assignment: Unit #9 - Filtering Data (part 2 of 2)
196
Reading Assignments tbd
197
Quick Logicals Review Dim iValue_In As Integer Dim istat As Integer
Private Sub cmdProcess_IO_Click(sender As Object, e As EventArgs) Handles cmdProcess_IO.Click Dim iValue_In As Integer Dim istat As Integer 'iValue_In = frmIO_Access.Input_(DIGINPORT) 'get input from the switches iValue_In = Val(txtIO_Value.Text) 'get the screen value lblHex_Value.Text = Hex(iValue_In) & "H" 'display as hex iValue_In = iValue_In And &HBD 'Clear bits 1 and 6 iValue_In = iValue_In Or &H 'Set bits 2 and 5 iValue_In = iValue_In Xor &H 'Invert bits 0 and 7 'Leave bits 3 and 4 alone radBit0.Checked = iValue_In And &H01 'bit 0 radBit1.Checked = iValue_In And &H02 'bit 1 radBit2.Checked = iValue_In And &H04 'bit 2 radBit3.Checked = iValue_In And &H08 'bit 3 radBit4.Checked = iValue_In And &H10 'bit 4 radBit5.Checked = iValue_In And &H20 'bit 5 radBit6.Checked = iValue_In And &H40 'bit 6 radBit7.Checked = iValue_In And &H80 'bit 7 istat = frmIO_Access.Output_(DIGOUTPORT, iValue_In) 'turn on the LEDs lblHex_Output.Text = Hex(iValue_In) & "H" 'display on the screen End Sub
198
ASCII Table Hex MSD: 0 1 2 3 4 5 6 7 Hex LSD 0 NUL DLE SP 0 @ P ' p
SOH DC1 ! A Q a q STX DC2 " B R b r ETX DC3 # C S c s EOT DC4 $ D T d t ENQ NAK % E U e u ACK SYN & F V f v BEL ETB ` G W g w BS CAN ( H X h x HT EM ) I Y i y A LF SUB * : J Z j z B VT ESC ; K [ k { C FF FS , < L \ l | D CR GS _ = M ] m } E SO RS > N ^ n ~ F SI US / ? O o DEL
199
String Functions ‘returns the middle 4 characters of the string starting at position 3: sNew = Mid(sName, 3, 4) i = Len(sName) ‘returns the length of sName sPart = VB.Right(sName, 4) ‘returns the right 4 characters sPart = VB.Left(sName, 4) ‘returns the left 4 characters ‘returns the position in str1 where str2 starts: lngPos = Instr(str1, str2)
200
Mid String Function Example: sName = “May the force be with you!”
‘returns the middle 5 characters of the string starting at position 9: sNew = Mid(sName, 9, 5) Example: sName = “May the force be with you!” sNew is now equal to “force”
201
Len String Function Example: sName = “May the force be with you!”
i = Len(sName) ‘returns the length of sName Example: sName = “May the force be with you!” iLength = Len(sName) iLength is now equal to 26
202
Right/Left String Functions
sName = “May the force be with you!” sBegin = VB.Left(sName, 3) ‘returns the left 3 characters sEnd = VB.Right(sName, 4) ‘returns the right 4 characters sBegin is now equal to “May” sEnd is now equal to “you!”
203
Instr String Functions
‘returns the position in str1 where str2 starts: lngPos = Instr(str1, str2) Example: sName = “May the force be with you!” iLocation = Instr(sName, “the“) iLocation is now equal to 5
204
STR Function Returns a Object (String) representation of a number. A leading space is always reserved for the sign of the number, however a plus sign is implied and not actually shown. objAge = Str( iAge_Integer ) sPrompt = “I am “ & objAge & “ years old”
205
String Manipulation strNew = UCase(sOld) Converts to uppercase
strNew = LCase(sOld) Converts to lowercase strNew = LTrim(sOld) Strips off the leading spaces strNew = RTrim(sOld) Strips off the trailing spaces strNew = Trim(sOld) Strips leading and trailing spaces intChar = Asc(“A”) returns the numeric equivalent strChar = Chr(&h41) returns the equivalent character strNew = Space(5) returns five spaces strNew = String(5, “A”) Returns five “A” characters Lset strNew = “Hello” Left justifies “Hello” into sNew Rset strNew = “Hello” Right justifies “Hello” into sNew intStat = StrComp(sS1, sS2) Compares two strings for equality
206
Rounding of Integer Variables
Assigning a fraction to an integer type variable will result in “Banker’s Rounding”. It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction. Round normally up/down but if the fractional number is 0.5 then round to the nearest EVEN number. iSum = ‘result is 3 iSum = ‘bankers rounding will result in 4 iSum = ‘result is 4 iSum = ‘result is 4 iSum = ‘bankers rounding will result in 4 iSum = ‘result is 5
207
Integer Function - INT()
Returns the integer portion of a number. If the number is negative, INT returns the first negative number less than or equal to the number. I.e. For negative numbers, it rounds down to the “more negative” number, it does not truncate. I.e. AwayFromZero iResult = Int(3.45) ‘returns a 3 iResult = Int(7.8) ‘returns a 7 iResult = Int(-5.8) ‘returns a -6 iResult = Int(-5.1) ‘returns a -6
208
Rounding of Numbers The Integer function is used to round off numbers (normal). i = Int( x ) ‘round OFF to the nearest integer i = Int( x * ) / ‘round to the 0.1 i = Int( x * ) / ‘round to the 0.01 i = CInt( x ) ‘rounds off using Bankers Rounding i = CInt(3.4) ‘returns a 3 i = CInt(3.6) ‘returns a 4 i = CInt(-3.4) ‘returns a -3 i = CInt(-3.6) ‘returns a -4 i = CInt(3.5) ‘returns a 4 – round to nearest EVEN if 0.5 i = CInt(4.5) ‘returns a 4 - round to nearest EVEN if 0.5
209
Rounding and Truncating Summary
intVariable = The fraction is “Bankers Rounded” Int(3.56) The fraction is truncated i = CInt(3.56) The fraction is “Bankers Rounded” sNbr = Math.Round(4.45, 1, MidpointRounding mode.AwayFromZero) sNbr = Math.Round(4.45, 1, MidpointRounding mode.ToEven) Rounding away from zero (AwayFromZero) Midpoint values are rounded to the next number away from zero. For example, 3.75 rounds to 3.8, 3.85 rounds to 3.9, rounds to -3.8, and rounds to Rounding away from zero is the most widely known form of rounding. Rounding to nearest, or banker's rounding (ToEven) Midpoint values are rounded to the nearest even number. For example, both 3.75 and 3.85 round to 3.8, and both and round to Rounding to nearest is the standard form of rounding used in financial and statistical operations. It conforms to IEEE Standard 754, section 4. When used in multiple rounding operations, it reduces the rounding error that is caused by consistently rounding midpoint values in a single direction. In some cases, this rounding error can be significant.
210
Demo3 String Demonstration
Dim sNbr As String 'just the number of the address Dim sName As String 'just the street name Dim sType As String 'just the street type, i.e avenue, street, road, etc Dim sAddress As String 'the full address Dim iSpc1_Before_Name As Short 'this will be the space before the house name Dim iSpc2_After_Name As Short 'first space after the house name sAddress = txtStringDemo.Text 'assume: "1111 Main Street" iSpc1_Before_Name = InStr(sAddress, " ") ' get the space AFTER the house nbr iSpc2_After_Name = iSpc1_Before_Name + InStr(VB.Right(sAddress, Len(sAddress) – iSpc1_Before_Name), " ") ' get the space AFTER the street sNbr = Str(Val(sAddress)) 'get the house number sName = Trim(Mid(sAddress, iSpc1_Before_Name, iSpc2_After_Name – iSpc1_Before_Name)) ' get the street name sType = Trim(VB.Right(sAddress, Len(sAddress) - iSpc2_After_Name)) 'street type 'now put the three fields back on the form to see what we have done lblNbr.Text = sNbr lblName.Text = sName lblType.Text = sType
211
The End Thank You !
212
Week #11 – Sensors Home Assignments: 1. tbd
2. Mini-Assignment: Tire Rotation 3. Lab Report #2 (unit 8/9) due NEXT week Lab Assignment: Unit 10 – Sensors (2 week lab) Nov 7 – Job Fair , 9:30am-1:30pm
213
Reading Assignments
214
“Neural Dust” Sensors Could Lead to Implantable Wearables
Article written on August 25, 2016 by Kate Smith The neural dust prototype attached to a nerve fiber in a rat. Image courtesy of UC Berkeley.
215
Sensor Types Discrete – Have a single on/off trigger point
Limit Switches SPDT DPDT Analog Sensors - measure a range of input conditions such as temperature, RPM, or pressure which are converted to signals such as 0-5 volts, 0-10 volts or 4-20mA. Non-contact Sensors Proximity Photo-electric Smart Sensors A smart transducer is an analog or digital transducer or actuator combined with a processing unit and a communication interface. Although ScorBot cannot interface directly to them, they can be connected to the BasicStamp which collects the data and then provides a true/false command to ScorBot.
216
Smart Sensor Examples Omega carries many different sensors:
Non-Contact Level Controller for Small Tank Applications The LVCN414 Series is a non-contact, ultrasonic level controller and transmitter that delivers reliable, cost-effective, high-performance, small-tank fluid handling control solutions. The LVCN414 targets process, control and chemical feed applications in small tanks mounted on skids, tools or machines. It is easily configured through a USB connection and Windows compatible software. The LVCN414 allows for real-time/ anytime measurement, lowering operational costs and increasing productivity. The LVCN414 is a total small tank level control and measurement solution. A-33 RTD Transmitter
217
Sensors & Relays we will be using
Detects the presence of an object. Detects the absence of an infrared light source. . DPDT Relay, +12V coil The datasheets for these are located on the class website.
218
Proximity Sensor Detects the presence of an object.
Detects the presence of an object using a coil and ferrite core as the sensing mechanism. It will detect an object that gets very close to it (3-12mm). The datasheet for this is located on the class website.
219
Proximity Sensor Traditional inductive proximity sensors are designed for wear-free, non-contact detection. Featuring a coil and ferrite core arrangement, they generate a high-frequency electromagnetic field. When a target passes through the magnetic field, currents induced on the surface of a target result in the loss of energy in the oscillator and generate a signal to turn the solid-state output On or Off. Once a metal object exits the sensing field, the oscillator regenerates and the sensor returns to its normal state. Ferrite Core Proximity Sensor
220
Detects the absence/presence of an infrared light source (within 2 m).
Photoelectric Sensor Detects the absence/presence of an infrared light source (within 2 m). The datasheet for this is located on the class website.
221
Banner SM312D – Diffuse Mode Sensor
Range to 380 mm (15") Highly repeatable 1 millisecond response Both sourcing and sinking outputs (150 mA max. each) at 10-30V dc.
222
Bottle Sensors http://www.balluff.com/balluff/MUS/en/products.jsp
223
Incremental Encoder Example
Does not provide positional information Non-contact thus reduced wear Greater resolution and accuracy Larger size than potentiometers
224
Absolute Encoder Example
Also provides rotational position information. The higher the resolution, the higher the cost.
225
Resolution Explanation (both methods are used)
Resolution - The resolution of a measurement system is the smallest value that can be distinguished. Encoder resolution can be defined as counts per turn (720), pulses per degree, (720 / 360 = 2 pulses per degree), degree resolution (360 / 720 = 0.5 degree) or simply 12-bit (and you compute the degree). Encoders usually have from 100 to 6,000 segments per revolution. This means that these encoders can provide 3.6 deg of resolution for the encoder with 100 segments and 0.06 deg of resolution for the encoder with 6,000 segments. Resolution = Total Pulses per Turn / 360 degrees
226
BTA1-2C 12V Relay DPDT – Double Pole, Double Throw
N.O. – Normally Open Contacts N.C. – Normally Closed Contacts Contacts are rated for 10A at 120VAC +12V Coil The datasheet for this is located on the class website.
227
Relay Driver Circuit The Diode across the relay coil protects the output transistor from “back EMF” that occurs when the relay coil is de-energized.
228
Relay Driver Board
229
Motor Forward/Reverse Logic
230
Motor Connection Diagram
231
Lab Comments Lab #10 (Sensors) Option:
If you are familiar with the Arduino, you may do this lab with the Arduino instead of the PMD module. Everyone will use the Arduino in Lab#11 (Switch Debounce). The instructor will set up the hardware for Experiments 1, 2, and 3 (circuits 4, 5, and 6). Lab#11 Arduino Information: Low-priced Arduinos can be purchased at Arduino Uno R3 will cost about $3.00 ($4.00 with a USB cable) An Arduino starter kit will cost about $7.00 Other Arduino sites which contain tutorials and example code:
232
Lab#10 – Help for Experiment#6
If the Motor_Direction Sensor input is High then Set the direction output (bit 1) to High Else Set the direction output (bit 1) to LOW End If If the Motor_On-Off Sensor input is LOW then Set the Motor_On-Off output (bit 0) to HIGH (motor=on) Set the Motor_On-Off output (bit 0) to LOW (motor=off) Else If
233
Personal Microcontrollers
Raspberry PI – Fully functional computer (~$35-$40) Linux OS and Ethernet Capable 17 Digital I/O Pins but lacks analog I/O (must be an add-on) Programmed via Python, C, C++, Java, Scratch, and Ruby Arduino Uno – Microcontroller (~$3-$29) 14 Digital I/O Pins (6 can be used as PWM outputs) 6 Analog Inputs Programmed via C SPI (Serial Peripheral Interface) for clocked synchronous data Optimized to interface with sensors and devices Parallax BasicStamp 2 ($49 plus a carrier board) Programmed via PBasic 16 Digital I/O Pins (plus 2 serial pins)
234
CCAC Classes (microcontroller related)
MIT-240 : Scientific and Industrial Instrumentation Uses the Arduino microcontroller to control the experiments. MIT-104 : Microcontrollers Uses the Arduino and Basic Stamp microcontrollers Software (Arduino C) and Hardware orientated (hardware labs)
235
The End
236
Week #12 – Sensors (continued)
Home Assignments: 1. Read the textbook sections as stated in the syllabus. Lab Assignment: Unit 10 – Sensors and Relays (continued) Work on optionals! Have you registered for Spring Classes Yet?
237
Raspberry PI Zero W Www.AdaFruit.com has these in stock:
Raspberry PI Zero Version 1.3 ($5) Raspberry PI Zero W ($10) has built-in WiFi
238
Harvard's new RoboBee can fly in and out of water
239
Embedded Automotive Systems
240
Linear Actuator
241
Linear Actuator Circuit
242
Example: Using Logicals to Make Decisions
Private Sub cmdIO_Decision_Click(sender As Object, e As EventArgs) Handles cmdIO_Decision.Click Dim iInput As Integer Dim iResult As Integer iInput = frmIO_Access.Input_(DIGINPORT) iResult = iInput And &H06 'clear bits 0 and 3 to 7 If iResult > 0 Then 'iResult is >0 if bit0 is high txtIO_Decision.Text = "Input Bit 0 is High" Else txtIO_Decision.Text = "Input Bit 0 is Low" End If End Sub
243
Example: Using Logicals to Make Decisions
Private Sub cmdIO_Decision_Click(sender As Object, e As EventArgs) Handles cmdIO_Decision.Click Dim iInput As Integer iInput = frmIO_Access.Input_(DIGINPORT) If (iInput And &H06) Then ‘the result is >0 if bits 1 & 2 are high txtIO_Decision.Text = "Input Bit 0 is High" Else txtIO_Decision.Text = "Input Bit 0 is Low" End If End Sub
244
Timer Control Preview ‘This automatically monitors the sensor status at input bit#0 ‘ Add a timer control to your form then enter this code Private Sub tmrIO_Tick() Dim iInVal As Integer iInVal = frmIO_Access.Input_(DIGINPORT) If (iInVal And &H01) Then txtDisplay.Text = “ON” Else txtDisplay.Text = “OFF” End If End Sub
245
Week #13 - Switch Debounce
Home Assignments: Read the textbook sections as stated in the syllabus. Do Unit 11 – Switch Debounce Lab Assignment: Unit 11 – Switch Debounce The final exam will consist of a take-home section to be given out on Dec 5 and due on the last night, Dec 12. The in-class section will be taken as normal on Dec 12.
246
Review of the Semester Agenda
Week#11 - Oct 31 Lab#10, Sensors Part 1 Week#12 - Nov 7 Lab#10, Sensors Part 2 Week#13 - Nov 14 Lab#10, Sensors (last night to finish) Lab#11, De-bounce Week#14 - Nov 28 Lab#11, De-bounce Lab#12, Analog and Video Week#15 - Dec 5 : Review Lab#12, Analog and Video (wrap-up) Week#16 - Dec 12 : Final Exam
247
Reading Assignments https://www.youtube.com/watch?v=hAVQpKVck9s
(corrected link)
248
Timer Types BI-STABLE TIMER (free running)
These run continuously - every time the timer expires, it is restarted. They are used for periodic events such as temperature monitoring. frmMain.tmrTimer_Timer This is also known as an ASTABLE timer. MONO-STABLE TIMER (one-shot) These run once and then stop. They are used to implement delays such as a 60 second crosswalk (street) sign. frmMain.tmrTimerDelay_Timer
249
Timer Properties tmr_Pixy_Read.Enabled = True ‘ enable this timer
tmr_Pixy_Read.Enabled = False ‘ disable this timer tmr_Pixy_Read.Interval = ‘ set timer to 10ms tmr_Pixy_Read.Interval = ‘ set timer to 1 second
250
Clock Bi-stable Timer Example
Private Sub tmrClock_Tick(sender As System.Object, e As System.EventArgs) _ Handles tmrClock.Tick lblClock.Text = TimeOfDay.ToString("h:mm:ss tt") End Sub
251
Bi-Stable Timer Example
Private Sub tmrDisplay_Tick() Static iCounter As Integer iCounter = iCounter + 1 If iCounter > 254 Then iCounter = 0 txtShow.Text = iCounter 'display the value on the screen End Sub
252
Timers - One Shot Mono-stable
Timers are used to invoke events on a periodic basis. ‘start the timer when this is clicked Private Sub cmdTest_Click() tmrTimerDelay.Interval = ‘ set for 0.5 second tmrTimerDelay.Enabled = True ‘ start the timer End Sub Private Sub tmrTimerDelay_Timer_Tick() ‘ This is called when the timer is terminated tmrTimerDelay.Enabled = False
253
Delay Timer ' this will cause a delay equal to the argument times 0.25 seconds Public Sub Wait(iNbrQtrSeconds) iDelayCnt = iNbrQtrSeconds frmMain.tmrTimerDelay.Enabled = True 'start the delay While iDelayCnt > 0 If frmMain.tmrTimerDelay.Enabled = False Then iDelayCnt = iDelayCnt - 1 frmMain.tmrTimerDelay.Enabled = True End If DoEvents Wend frmMain.tmrTimerDelay.Enabled = False 'stop the timer End Sub
254
Debounced Switch
255
Switch Bounce
256
The End Thank You !
257
Week #14 - Analog Video Tracking
Home Assignments: 1. Read the textbook sections as stated in the syllabus. 2. Do Unit 12 – Analog I/O & Video Tracking Lab Assignment: Unit 12 – Analog I/O & Video Tracking
258
Changes to the Syllabus
The original syllabus called for three formal lab reports. This has been reduced to TWO formal lab reports: Unit#4, Decision and Control Units# 8 & 9, Filtering The syllabus has been updated on the class website. NOTE: You should use this extra time to finish the remaining lab assignments and to prepare for the final exam.
259
Review of the Semester Agenda
Week#11 - Nov 1 Lab#10, Sensors Part 1 Week#12 - Nov 8 Lab#10, Sensors Part 2 Week#13 - Nov 15 Lab#10, Sensors (last night to finish) Lab#11, De-bounce Week#14 - Nov 29 Lab#11, De-bounce Lab#12, Analog and Video Week#15 - Dec 6 : Review Lab#12, Analog and Video (wrap-up) Week#16 - Dec 13 : Final Exam
260
Pseudo code for the tmrPixy_Read control
This is the pseudo code for the tmrPixy_Read control: Read the digital input port ((DIGSWITCHPORT) Clear bits 1 to 7 and leave bit 0 alone If Bit 0 is high Then Change the “checked” property of the radio button to True Read the analog input port (ANALINPOT) and put the value in shStat Set the “value” property of the progress bar equal to shStat Else Change the “checked” property of the radio button to False EndIf
261
Reading Assignments
262
Nike Self-Lacing Sneakers Video
263
Analog Definition Digital - Only two states: 0 volts and +5V
1 = On = Set = +5Volts = High 0 = Off = Clear = 0Volts = Low Analog - Unlimited number of states between a lower and an upper value. 0V, 0.02V, 0.04V, 1.44V, 3.60V, 5.00V
264
Connection Diagram for an ADC
265
Connection Diagram for an ADC
266
Selection Criteria for an ADC
Analog Signal Range : 0-5V, 0-10V, -5V to +5V Cost Signal-Conditioning Requirements Conversion Speed : 10Ksps to 200+Msps Analog Resolution : 8 to 17+ bits Accuracy is affected by: Offset Gain Nonlinearity The stability of the reference voltage
267
ADC Resolution ADC Resolution is the smallest change in voltage that the ADC can measure. An eight-bit converter has a resolution of: 1/(28) = 1/256 = times the full scale input voltage I.e. it can measure a signal of * 5V = Volt (~20mV) Volts / Bits = 5-0 / 256 = Volts per bit = 19.5mV per bit (~20mV)
268
Analog Input Scaling Assuming: The analog input is from 0 to +5 volts
The digital port is an 8-bit port (0 to 255) The screen position ranges from 0 to 21 (22 positions) The temperature represented by the input voltage can range from zero to 510 degrees
269
Analog Input Sensors Thermocouples - for extreme temperatures
Thermistors - for extreme chemical environments RTD - Resistance-Temperature-Device Pressure Transducers - for air, fluids Strain & Force Gauges - for mechanical measurements Acceleration and Torque - for movements Flow These are covered in MIT Instrumentation
270
Accuracy versus Precision
How does this relate to resolution? Accuracy versus Precision
271
Lab Temperature Sensor
The lab temperature sensor has the following parameters: Temperature range from 0 to 200 F Outputs .01 volts (+10mV) per F Maximum output is: 200F * .01V = 2Volts But since the A-D has a resolution of mV, it will be able to "see" changes of only 2 degrees. Thus: One LSB = 2F Extrapolating further, the maximum raw A-D count when using this temperature sensor as the input is: 200F maximum / 2F = max A-D count / =
272
Accessing the Analog Input Port
This will read the Analog Input port that is connected to the potentiometer on the Blue I/O box: shStat = frmIO_Access.Input_(ANALINPOT) This will read the Analog Input port that is connected to the light sensor on the Blue I/O box: shStat = frmIO_Access.Input_(ANALINLIGHT)
273
Group Assignment - Analog
Assume that you have a 11-bit Analog to Digital chip with a range of 0-5V. Also assume that it is connected to a pressure transducer that has a range of PSI and outputs a 0-5v signal. What is the smallest increment of pressure that can be measured? What is the smallest increment of voltage that can be measured? What voltage is measured at a pressure of 105 PSI? What digital value indicates a pressure of 105 PSI?
274
Pixy Camera Electrical Interface
275
Pixy Tracking Camera Lab
Group Box Control Explanation (discussed in Week#10) Timer Control Explanation (discussed last week) Getting the Object Detected Signal: shDetect = frmIO_Access.Input_(DIGINPORT) Getting the Object Location: shLocation = frmIO_Access.Input_(ANALINPOT) The analog location provides the X location of the detected object and has a range of 0 to 165 or 255 where 0 is to the extreme left and 165 or 255 is to the extreme right.
276
Analog Ports used during testing
Signal Test#1 Desk / No PMD Test#2 Blue I/O Box Test#3 Pixy Camera Object Detect DIGSWITCHPORT Bit 0 Location ANALINPOT ANALINPORT0 You will test three times: Desk in simulation mode with no hardware You will not see a change in the object detect signal With the Blue I/O box using switch#0 and the analog potentiometer With the Pixy camera You must use a different Analog port when you test with the Pixy camera.
277
The ProgressBar Control
prbPixy.Maximum = 255 prbPixy.Value = iValue Two key properties of a ProgressBar: Value: the current value for the ProgressBar, in the range specified by the minimum and maximum properties. Maximum: the upper bound of the range this ProgressBar is working with.
278
The End Thank You !
279
Week #15 – Catch-up & Final Course Review
Agenda: 1. Take-Home Part of the Final Exam to be given out tonight 2. Load Cell / Arduino Demo Lab Assignment: Finish Unit 12
280
Agenda Review Closing Discussion Course Survey & Improvement Exercise
281
Review: Analog Calculations
Assume that you have a 11-bit Analog to Digital chip with a range of 0-5V. Also assume that it is connected to a pressure transducer that has a range of PSI and outputs a 0-5v signal. What is the smallest increment of pressure that can be measured? What is the smallest increment of voltage that can be measured? What voltage is measured at a pressure of 105 PSI? What digital value indicates a pressure of 105 PSI?
282
Review: Making a Bit-Level decision
This example shows how to make a decision based on a single bit: shDetect = frmIO_Access.Input_(DIGINPORT) shDetect = shDetect And &H ‘leave bit 3 alone and clear all other bits If shDetect > 0 Then ‘ Greater than zero means bit 3 is high txtDisplay.Text = “Bit 3 is High” Else txtDisplay.Text = “Bit 3 is Low” EndIf
283
Do you want to be a millionaire?
Tonight, I will show you how.
284
Success with Retirement Goals
Many companies match half (3%) of the first 6% of your contributions to a 401K retirement plan. Assuming a salary of $30K/year and a company matching contribution of 3% if you contribute 6%, the company will be giving you $900 if you contribute $1800 / 12 = $150 each month. BUT, your contribution of $1800 is not taxable so you will also pay $360 less in taxes for the year (assume 20% tax bracket). Your contribution of $1800 yields you $1.8K + $900 + $360 = $3060 What would be a good reason to justify not contributing?
285
Three Retirement Assumptions
If you get a raise to $30/hour would you agree to put $3 (10%) of it towards your retirement account every paycheck? Assume your employer will contribute 3% to your 401K retirement account. The most common type of fixed match, reported by 40% of employer's, is $.50 per $1.00 up to a specified percentage of pay (commonly 6%). You will contribute at least enough (6%) to earn the full employer contribution of (3%). Assume you will earn an average of 7% on your account. The average annual return for the S&P 500 since its inception in 1928 through 2014 is approximately 10%.
286
Retirement Improvements
Are you willing to increase your contributions by 1% each year, until you are at the maximum allowable contribution? Selecting low fee funds will significantly improve your annual gains. When you are still young, you can safely select a higher ratio of stocks to bonds, thus you should achieve an annual return closer to 10% (rather than 7%). Many employers will contribute more than 3%.
287
Course Improvement Ideas
Textbook versus Online reading material? Hardware versus Software time allocation? Lecture versus Lab time allocation? Which lab or topic is the best? Should we eliminate a lab or topic? Is there adequate lab electronic equipment? Are the room facilities adequate? i.e. desks, chairs, lighting, etc. Are the PCs adequate? Did the Formal Lab Reports help you understand the Material? Were the lectures too fast or slow? ANYTHING ELSE…
288
Unit / Lab Assignment Ranking
Ranking: 1 to 10 1 = Least Liked 10 = Best Unit1 - The VB Demo Unit2 - The VB Form Unit3 - Variables and Constants Unit4 – Decisions and Control Unit5 – Hex Data Unit6 - Logicals Unit7 - Digital I/O Ports Unit8 and 9 - Filtering Data (Part 1 and 2) Unit10 – Sensors Unit11 – Debounce Unit12 – Vision Tracking
289
The End
290
Week #16 - Final Exam Exam Time: Normal Class Start Time
You are welcome to start the exam early All outstanding work is due.
291
Final Wrap-up Final Exam All Labs and Materials are due
292
The End
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.