Midterm Flashcards
Binary base/radix
2
binary possible values
0 and 1
binary digits
bit
Nibble
4 bits
Byte
8 bits
Word
16 bits
B01101101
Binary (don’t count first 0)
number of possible values for binary
2^8
octal base/radix
8
octal possible values
0-7
012364
octal (don’t count first 0)
octal number of possible values
8^5
3 bit direct correlation of octal and binary
0=000;1=001;2=010;3=011;4=100;5=101
hexidecimal base/radix
16
hexidecimal possible values
0-F
0xC5SF
hexidecimal
hex vs binary relations (4 bits)
0=0000;1=0001;2=0010;3=0011;4=0100;5=0101
how to convert decimal into binary
divide by 2, have quotient table and remainder
convert decimal into octal
divide by 8, have quotient table and remainder
convert decimal into hex
divide by 16, have quotient table and remainder
How do you add binary
convert numbers into binary and then put them on top like beginner multiplication
When using a pullup resistor, what is the state of the input when the button is pressed?
the pin is low when the button is pressed
For an up/down counter, when is the output of the counter true?
When it has reached zero
When are PLCs used?
In dirty, uncomfortable, high vibration, high EMI (electromagnetic interference) environments. In industrial and manufacturing plants.
What built in safety features do PLCs have?
Convection cooling if mounted on vertical surface, opto-isolator protected inputs, transistor and relay isolated outputs, and a faraday cage.
What is the benefit of using interrupts vs polling?
Avoids missing button presses.
A pushbutton that has a default state of being connected is normally…
Normally closed
What is the major difference to a do loop as compared to a while or for loop?
a do loop always runs once
Two other examples of while(1);
while(true){} and while(x=1); if its already established in the code
to flash a single light a 2Hz, what should the delay lengths be?
delay(250);
How would you write (if x is less than 5 or equal to 10)?
if(x<5||x==10){blahblah}
what is the difference between = and ==
= makes it that value. == checks if its the same value
what does millis() do?
It returns the number of milliseconds passed since the arduino program started.
What is an unsigned long?
has storage of 32 bits
what does randomSeed() do?
random number generator, but always the same.