Exam 2 Physical Computing 03/22-04/26
What is the step angle and steps/rev for the Adafruit.it/324?
- 1.8 degrees - 200 steps/revolution
What is the Trigger Input Pulse width and Sonic Burst Frequency of the HC-SR04?
- 10 micro-seconds - 40 kHz
What is the distance, resolution, and range angle of the HC-SR04?
- 2 cm - 200 cm - .3 m - 30 degrees
How many signal wires does the LCD need? What are the signals?
- 2 wires - Serial Clock - Serial Data
How many DC motors and Stepper motors can be attached with one motor HAT
- 4 DC motors - 2 Stepper motors
What is the Power supply and current of the HC-SR04?
- 5V - 15 mA
What is the Step motor being used in class?
- Adafruit.it/324 - bipolar Stepper Motor
Describe Double steps?
- Energize both coils to hold the motor in place - Consumes more power but is stronger than the Single Step
An ________ is known as object and the process of creating an object is known as ____________
- Instance - Instantiation
What are the two types of class attributes?
- Instance - Static
Describe Interleaved steps?
- Mix of single and double stepping. - enables to have twice the number of steps providing a smooth transition between steps.
What makes up a servomotor?
- Potentiometer - Gear assembly - Controlling Circuit
What are the three types of Modifiers?
- Public - Private - Protected
Explain the signal process for the DHT11
- RPi sends start signal - DHT11 switches from low power to running mode - DHT11 sends 40 bit response - DHT11 switches from running to low power mode
What are static variables or class attributes?
- Shared among all instances or objects of a class - Defined outside of instance methods but within the class
Describe single steps?
- Simplest type of stepping - uses the least amount of power - Energize's a single coil to hold the motor in place.
Explain how the distance measurement of the HCSR04 works?
- The TRIG pin goes high and transmits 8 cycle sonic burst in 10 microseconds, then goes low - ECHO pin goes high at the end of the 10 micro seconds and will stay high until the bursts are received.
Describe the process of a Thread?
- Thread is created, but is not yet runnable - Has to be started ( start() ) - Once started, it is runnable and eligible to be running by decision of the scheduler - Can be switched between running and runnable by scheduler ( Alive ) - Can be put into waiting where it won't be able to go back to running until going through runnable ( join() ) - This can run until run() method is applied and terminates the thread until it is DEAD
Describe Interleaved steps?
- Uses PWM with Single Stepping. - Each step is divided into 8 micro steps providing higher precision.
What are the three pins to the DHT11?
- V (3.5 - 5) - GND - Data - The fourth is hidden
How do you properly import the LCD modules to make it work?
- import sys - sys.path.append('/home/es2800/Code') - import LCD1602 as lcd
What are the three components to the DHT11 sensor?
- resistive-type humidity measurement component - NTC(Negative Temperature Coefficient) Thermistor - 8 bit micro-controller
List the thread functions in order.
- wait() setting an object into a thread - set() put into action - join() puts into waiting - run() Terminates thread
How many leads do uni-polar motors have?
-6 -5 -8
What are the two types of LCD's?
-Character(Alphanumeric): text and icons -Graphic:
What happens when the infrared light is reflected at the minimum level? What happens when the IR light is at max level?
-It has encountered a black surface. -It causes the output signal to go high
What happens when the infrared light is reflected at the maximum level? What happens when the IR light is at max level?
-It has encountered a white surface. -It causes the output signal to go low
What three subpixels is a pixel made up of?
-Red -Green -Blue
The four types of steps for stepper motors are...
-single -double -interleaved -Microstep
A typical normal rotation angle range for a servo motor is...
0-180 degrees
What range of frequency can the I2C communicate at?
100 kHz - 400 kHz
How many Peripheral devices can I2C support?
1008
The number of signal wires used with the I2C protocol is...
2
What is the range of sound-wave frequencies audible to humans?
20Hz to 20kHz
How many leads do bi-polar motors have?
4
How long is the DHT11 Communication Process?
4 ms
How many cycles are in the sonic burst of the HC-SR04?
8
What does DHT11 40 bit data all consist of?
8 integral RH + 8 decimal RH + 8 integral Temp + 8 decimal Temp + 8 error checksum
What is an Sg90 servomotor rated for?
9 g/cm
A method with the name 'Direction' can be modified to a setter property method by decorating the method with the decorator...
@Direction.setter
How can a class instance method be converted to a setter method?
@Methodname.setter
A class method can be converted to a static class method by decorating the method with the decorator...
@staticmethod
What is the thread consisting of thread object known as?
A Lightweight, because it does not possess its own address and is not treated as a separate entity.
What is a class?
A blueprint that defines an objects variables and methods.
What is a step motor?
A cogged rotor with alternating north and south poles and electromagnets to nudge the wheel around a step at a time.
What is a constructor?
A constructor is a method that executes automatically when an object is instantiated - __init__(self,...) - SHOULD NOT BE CALLED EXPLICITY
What is a decorator?
A piece of code that is used to mark a callable object to replace its original behavior
What is a Thermistor?
A temperature dependent resistor
The instance of the class Circle is known as...
An object of type Circle
How is a servomotor controlled?
By PWM - Angle of rotation is controlled by the duration of the applied pulse to its control pin
How are static attributes accessed?
By using the class name to which they are members of - class: Car - Static Attribute: __count=0 - Accessed by: Car.__count += 1
What does public attributes mean? How are they labeled?
Can be accessed anywhere in the program. - names without any underscores are public
What does private attributes mean? How are they labeled?
Can only be accessed within a class and methods belonging to the class. - names starting with double underscores are private
What does the isinstance function do?
Checks to make sure the instance variable is what it's supposed to be
The method that is called implicitly when an object is instantiated is known as the...
Constructor
What is scope?
Defines the visibility or access level of an attribute - it's specified using Modifiers
A class property consists of two methods,namely the...
Getter and Setter methods
What does HAT stand for?
Hardware attached on top
What is 12C?
INTER INTEGRATED CIRCUIT to allow multiple chips to communicate with two or more controller chips
What is sound below the acoustic range referred to as?
Infrasound
The two types of class attributes are...
Instance and static attributes.
Which LCD is being used in class?
LCD 1602
What does LCD stand for?
Liquid Crystal Display
What are Methods?
Methods are functions that act on an object to change the attributes of the object.
The rotational speed of a DC motor can be varied by varying the average value of the GPIO Pin digital output voltage using...
PWM technique
What is a Getter property instance method?
Provides access to the value a private attribute.
What is a Setter property instance method?
Provides the mechanism to set the value of a private attribute.
What is the small amount of time a thread is allowed to execute called?
Quantum
What are Attributes/field or instance variables?
References to the state of the object
What happens to the NTC thermistor as Temp. increases?
Resistance decreases.
What kind of communication process does the DHT11 use?
Single wire, Two way
What is an H-Bridge?
Switches capable of controlling the rotational direction of DC motors.
What is the period or cycle time for a servomotor?
T=20 milliseconds=50 Hz
What are instance methods specific to?
The individual object of a class. They are defined inside a method. (Members of the class)
The quadruple half H-Bridges (two h-bridges) in the chip can control rotational direction and speed of...
Two DC motors
What is sound above the acoustic range referred to as?
Ultrasound
A thread object created by default is in the...
Un-Started state
What are the two types of step motors?
Uni-polar and Bi-polar
The 5V output of a sensor has to be measured using a GPIO pin of the RPi, the circuit used to reduce the 5V to a 3.3V output level is known as...
Voltage divider circuit
The name of the instance method called automatically when an object is instantiated is...
__init__ (constructor)
A thread object represents an activity that is run in...
a separate thread of execution within the same process
How are a Static methods defined?
by decorating it with @staticmethoddecorator
How can a class instance method be converted to a getter method?
by decorating the method with @property
The time measured from the instance the HC-SR04 Echo pin goes high to the Echo pin going low is proportional to...
distance between the sensor and an object reflecting the 8 cycles sonic burst
The command used in the bash shell to determine the address is...
i2cdetect -y 1
The main thread can be made to wait for its child threads to terminate by calling the...
join() method on the child thread objects
How are servomotors rated?
kg/cm - how much weight they can lift at a particular distance - Increase in distance decreases the amount of weight that can be lifted
How do you initialize the LCD?
lcd.init(0x27,1)
For the KY-033 and TCRT5000 when facing a white surface, recieves...
light reflected in the infrared range at maximum level
The command used in the bash shell to determine whether the I2C module is enabled or running is...
lsmod | grep 12c_
The library module used to monitor the keyboard using the threadlistener is...
pynput
The rotational direction of a DC motor can be changed by...
reversing the polarity of the voltage applied to the armature using anH-Bridge
What is the first parameter of an instance method?
self - to represent the object on which the instance method is executing. - reference to the object itself.
A thread object created is started by calling the...
start() method on the thread object
The time measured from the instance the HC-SR04 Echo pin goes high to the Echo pin going low is the...
the time elapsed from the instance the 8 cycles of the sonic burst was transmitted ,and the reflected sound was received
When the digital output signal form the infrared sensor is high, it indicates...
the transmitted infrared light has encountered an object of black color
A Raspberry Pi can control the rotational direction and speed of 128 DC motors using...
thirty-two stacked Adafruit MotorHATs
A 16x2 alphanumeric LCD can display...
two lines of 16 characters in each line
An event object can be set inside the thread by calling the...
wait() method on the event object - use set() outside the thread