Professional Documents
Culture Documents
Week 2 - Embedded Systems, Switches, Pseudocode, LabJack Programming(1)
Week 2 - Embedded Systems, Switches, Pseudocode, LabJack Programming(1)
WEEK 2
EMBEDDED SYSTEMS
WHAT ARE THEY?
Wikipedia:
https://en.wikipedia.org/wiki/Embedded_system
EXAMPLES
https://www.electronicshub.org/embedded-system-real-time-applications/
CAN YOU THINK OF SOME OTHERS?
LABJACK
WHAT IS A DAQ?
• DAQ – Data Acquisition Device
• A device that is used to collect physical information and make it usable for a
digital device (a computer).
• In other words, takes analog signals and makes them digital.
https://www.omega.ca/en/resources/daq-systems
ANALOG VS DIGITAL
https://runwayaudio.com
RESOLUTION
• Embedded systems have one or more inputs and one or more outputs.
• Inputs are READ.
• Outputs are SET.
NORMAL STATE
• Recall:
• Inputs are READ.
• Outputs are SET.
• As inputs are READ, we are looking for a change in state before we do
something.
• We need to know the normal state of an input before we can do something
with it.
SWITCHES
INPUT OR OUTPUT?
• Method of actuation.
• Number of contacts.
• Number of poles and throws.
TYPES
https://www.allaboutcircuits.com/textbook/digital/chpt-4/switch-types/
SPST
SPST
OUR SWITCH - SPST
From datasheet:
OTHER SWITCHES
SWITCH CIRCUITS
Switch S2 Closed
Switch S1 Closed
SWITCH CIRCUITS
while(condition)
{
statements;
update expression;
}
WHILE LOOPS WITH LABJACK
• Once you know your exit condition, you can build your while loop.
• Start with pseudocode! Writing it out in plain English makes it easier to later
fill in the LabJack sequences.
PUTTING IT TOGETHER
PSEUDOCODE
• Two circuits:
• Switch on AIN1 in pull-down configuration.
• LED ON when DAC1 is high.
• Program description:
• Program starts with LED off. LED turns on when pushbutton is pressed. LED turns off when
user pressed a button and program ends.
LABJACK PROGRAMMING