Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
65 Cards in this Set
- Front
- Back
what does the Processing serial library allow? |
2 computers to send and receive data and gives you ability to communicate with microcontrollers (can be input or output) |
|
how to import the Serial library in processing? |
import processing.serial.*; Serial myPort; // the serial port object
String[] portList = Serial.list(); //print out a list of available ports
println(portList);
myPort = new Serial(this, Serial.list()[0], 9600); |
|
what data types can be sent to the serial port? |
byte, char, int, byte array, and String |
|
what are the four steps to using Serial library in Processing? |
1. load library 2. set portname 3. open port 4. read/write port (done in loop) |
|
Serial.read() |
reads incoming serial data
returns an int, the first byte of incoming serial data available (or -1 if no data is available) |
|
Serial.available() |
get the number of bytes (characters) available for reading from the serial port
this is data that has ALREADY arrived and is stored in the serial receive buffer
returns # of bytes available to read |
|
Serial.peek() |
returns the next byte (character) of incoming serial data without removing it from the internal serial buffer |
|
Serial.write() |
writes binary data to serial port
this data is sent as a byte or series of bytes; to send the characters representing the digits of a number use the print() function instead |
|
degrees of freedom |
rotation around X axis = pitch/tilt rotation around Y axis = pan/yaw rotation around Z axis = roll
left to right = X axis up and down = Y axis front to back = Z axis |
|
ranging sensors |
sense distance of a body from the sensor sense movement in front of the sensor
MOST SENSORS range under 9 ft
for video tracking, range is adjustable depending on the zoom of the lens |
|
how do ranging sensors work? |
reads the distance from a target
work by sending out some reference signal - light, magnetism, sound
measure the amount of energy that reflects off the target and compare it with the energy that went out - difference converted into an electrical signal that can be read by a microcontroller |
|
detecting presence - foot switches |
work well within a small area
long strips of metal tape separated at intervals by foam tape - when someone steps on sensor, foam tape compresses and metal strips touch each other
NEED TO BE ROBUST -> ppl weight |
|
detecting presence - photo electric switches |
a light beam hits a target sensor
when the beam is broken by a body passing between the sensor and light source, the switch is activated |
|
detecting presence - magnetic switches |
very thin pair of contacts in a projective housing
when they're exposed to a magnet, they're drawn together, closing the switch |
|
detecting presence - motion detectors |
respond to changes in the infrared light in the space
only react to change - will not respond if someone is in the room and standing still |
|
infrared (IR) sensors |
send out an infrared beam and read the reflection of the beam off a target |
|
ultrasonic sensors |
longer ranges than IR
send out a ping of ultrasonic sound and see how long it takes to bounce back |
|
what's bad about distance ranging sensors? |
don't operate uniformly at all distances have zones in which they're most sensitive (remember triangular)
need to use several sensors to cover a room no two sensors operating at the same instant cuz interference |
|
accelerometer |
measure the change in speed of movement (acceleration)
typically have 2 or 3 axes of measurement |
|
video tracking |
video cameras:
dense array of thousands of photocells can adjust lighting conditions ability to separate incoming light by colour pixel-by-pixel manipulation by computer |
|
what's the best solution for determining the details of a person's motion in a large space? |
camera on a ceiling
use software to look for X and Y position of any pixels that are a diff colour than the floor |
|
what are factors to consider when video tracking? |
you need strong and even lighting throughout the space with high contrast
make sure video camera can see infrared light
when using camera on ceiling, try to hang camera as high as possible |
|
what are 2 basic types of motion? |
linear motion
rotary motion - motors |
|
how to convert rotary motion into linear motion? |
use basic mechanics and simple machines - lever - pulley - gear - cam - ratches - linkages |
|
what are some characteristics of motors? |
rated voltage current (stall or running?) motor speed position resolution (for servo/stepper motors) torque |
|
stall current vs. running current |
stall - maximum current drawn when the motor is applying its maximum torque, either cuz it's being prevented from moving or cuz it can't accelerate given the load
running - all motors will require more energy to get them started than it takes to keep them running |
|
Servo attach (), write(), read() |
attach() reads the Servo instance on the pin passed in to the method
servo.attach(pin);
read() reads the current angle of the servo |
|
advantages of Servo motor |
easy to control and precise
servo reads amount of voltage passed in to determine how far to rotate within a limited range (usually 180) |
|
how computers identify objects? |
use information from sensors
optical recognition
radio frequency identification |
|
optical recognition |
can take many forms - video colour tracking - shape recognition - barcode
identifiers - colours - shapes - barcodes |
|
barcode recognition |
pattern of dark and light lines or cells used to encode an alphanumeric string
computer reads the barcode by scanning the image and interpreting the light and dark bands as 0 or 1
scanning done by camera or photodiode |
|
barcode vs. QR code |
1D barcode -> regular barcode
2D barcode -> Quick Response Code - 2D matrix, more info density |
|
radio frequency identification (RFID) |
relies on tagging objects to identify them
RFID tags don't need to be visible to be read
RFID reader sends out a short range radio signal which is picked up by an RFID tag
the tag then transmits back a short string of data |
|
passive RFID |
tags contain an integrated circuit that has basic radio transceiver and non-volatine memory
powered by current that reader's signal induces in their antennas
received energy is just enough to power the tag to transmit its data once |
|
active RFID |
tag has own power supply and radio transceiver
transmits a signal in response to a received message from a reader
longer range, more expensive |
|
how to sense touch? |
force-sensitive resistors
thermistors
capacitance sensor |
|
force-sensitive resistors (FSR) |
convert mechanical force into electrical resistance
generally small, flat |
|
flex sensors |
look and work like FSR
vary resistance based on how much they're bent
flat plastic strip that can bend to 180 degrees |
|
pressure sensors |
measure pressure exerted by gas or fluid
most commonly used in pneumatic or hydraulic applications |
|
capacitance sensors |
sense electric change cuz human body always stores a small electric charge
can detect any object that carries a static charge |
|
touch interfaces/screens |
easiest way to connect touch with computer graphics
will only read contact at one point at one time
there's also multi touch touchpads |
|
other ways of sensing touch |
heat - you can detect if someone is touching an object by detecting an increase in heat using a thermistor
thermistors convert heat into electrical resistance
peltier junction = solid-state heat pump for creating hot or cold surfaces |
|
LED driver chip |
use it on arduino
control up to an 8x8 matrix of LEDs
use the Matrix library to control individual LEDs |
|
how to play sound with arduino |
piezospeaker
playing melodies with arduino makes use of PWM (digital pins 9, 10, 11)
piezos have polarity |
|
the simplest network |
one-to-one connection between 2 objects
before communication takes place, rules for communication have to be established
RULES = DIFFERENT LAYERS |
|
factors that influence communication between different machines and applications |
context
continuous, non-continous, asynchronous
the means of communication - how?
types of machines used - between what devices?
amount of data being exchanged |
|
benefits of communicating over a network |
enable your applications to work remotely
gather data from internet
network multiple devices and machines |
|
what are the layers of agreement in arduino to computer example? |
physical
electrical
logical
data
application |
|
physical layer |
how are the physical inputs/outputs of each device connected to the other
how many connections b/t 2 devices do you need
e.g. arduino receives data on pin 0 (RX) and sends it out on pin 1 (TX) |
|
electrical layer |
what voltage levels will you send to represent bits of your data?
e.g. arduino uses pulses of 0V and 5V to represent bits |
|
logical layer |
does an increase in voltage lvl represent a zero or a one?
e.g. 5V = 1; 0V = 0 |
|
data layer |
what is the timing of the bits? are the bits read in groups of 8, 9, 10? are there bits at the beginning or end of each group to punctuate the groups?
e.g. data is sent at 9600 bits per second and each package contains 8 bits |
|
application layer |
how are the groups of bits arranged into messages?
what is the order in which messages have to be exchanged to get something done?
e.g. at the application layer, one byte is sent from PC to arduino and processed |
|
complex network |
collection of networks
a map is needed to keep track of objects/addressing scheme |
|
different types of network connections |
directly connected network
star network
ring network
|
|
diff between hardware address and IP address? |
device's IP address can change when it's moved from one network to another
hardware address cannot change
hardware e.g. 00:11:24:9b:f3:70
IP e.g. 192.168.1.29 |
|
what is a machine's address and why is it important? |
in order for an application on one machine to send a message to an application on another machine, the sending application must identify the receiving application
TO IDENTIFY, you need: - name or address of host machine - identity of receiving process on destination host
receiving process = application |
|
what are ports? |
computer has single physical connection to network and all data arrives through that
data may be intended for different apps on the computer so ports organize that
ports are identified by a 16-bit number |
|
3 parts of structure of a network application |
user interface - allows user to invoke and control app functionality
application logic - software code, processing instructions that provide functionality
application-level protocol - defines format and order of messages exchanged |
|
transport layer of a network |
responsible for making sure packets get to their destination
2 protocols used to handle transport of packets on the internet - transmission control protocol (TCP) - user datagram protocol (UDP) |
|
packets |
data broken into smaller pieces for easier sending |
|
what does a server do? |
it's the receiver of request sent by a client
it's passive, waits for requests
upon receipt of requests, processes them and then replies
usually accepts connections from large number of clients
typically does not interact directly with end-users |
|
user datagram protocol (UDP) |
LIGHTWEIGHT transport protocol with minimalist service model
CONNECTIONLESS, no handshaking before two processes start to communicate
UNRELIABLE data transfer service - when a process sends a message into UDP socket, UDP provides no guarantee that the message will ever reach the receiving socket
no flow control mechanism so sending process can pump data into UDP socket at any rate
GOOD FOR REAL-TIME APPLICATIONS |
|
transmission control protocol (TCP) |
connection-oriented service - client and server exchange control info before messages flow (handshaking!)
full-duplex connection so two processes can send messages to each other at same time
reliable transport service, delivers all messages sent without errors and in the proper order |
|
open sound control (OSC) protocol |
protocol for communication among computers, sound synthesizers, and other multimedia devices
use for: real-time sound and media processing environments, software synthesizers, web interactivity tools |