Title: Theory / Unimportant / CS / Hardware / Arduino - Blum
Tags: hasNotNewEffectReturnsMeaning fromMath FromInstruction computer_to_instruction some_instruction algoToProg mathToDef mathToSee FromVariables algoToVar automatedNewLineAfterCommaSpace declaration type algoToType examplesSwitchExample1 hasSeenConjDef has_seen_instruction_2 instructionToVariable syntactical_sugar

Name: Microcontroller
Definition: Responsible for holding all of your compiled code and executing the commands you specify.
Page: 6
Chapter: 1

Name: Analog-to-digital converters
Page: 6
Chapter: 1
Abbreviation: ADCs

Question: Debugging led is
Answer: pin 13
Page: 6
Section: 1

Instruction: Reset button
Page: 6
Effect: Restart the program
Section: 1
Extra: prog

Name: Universal Synchronous/Asynchronous Receiver/Transmitter
Page: 6
Section: 1
Abbreviation: USART

Q: Possible power supplies:
-[...],
-[...]
-[...]
A: USB; Direct Current (7-12 V recommanded, 6-20 possible); V_in pin (same voltage)
Page: 7
Section: 1

Instruction: /*
foo
bar
buz
*/
Page: 16
Effect: Multiline comment
Chapter: 1
Extra: prog

Instruction: //Some text
Page: 16
Effect: Singleline comment, until end of line
Chapter: 1
Extra: prog

Instruction: type varName;
Page: 16
Effect: Variable declaration
Chapter: 1
Extra: prog

Instruction: setup()
Page: 16
Effect: The function called at initialization of the program
Chapter: 1
Extra: prog

Instruction: varName = expr;
Page: 16
Effect: Evaluate expr, assign its value to varName
Chapter: 1
Extra: prog

Variable: INPUT
Meaning: A constant used to state that some pin is an input
Page: 17
Section: 1
Index: variable

Variable: OUTPUT
Meaning: A constant used to state that some pin is an output
Page: 17
Section: 1
Index: variable

Instruction: pinMode(pinNumber,INPUT or OUTPUT)
Page: 17
Effect: Stating whether the pin pinNumber is input or output
Chapter: 1
Extra: prog

Instruction: void loop ()
Page: 17
Effect: The function repeated forever as long as the Arduino is on
Context: Arduino
Chapter: 1
Extra: prog

Question: By default, pin's are
Answer: input
Page: 17
Chapter: 1

Instruction: digitalWrite(pinNumber,Voltage);
Page: 18
Effect: Set the output voltage of pinNumber to voltage
Chapter: 1
Extra: prog

Variable: HIGH
Meaning: The constant 5V
Page: 18
Section: 1
Index: variable

Variable: LOW
Meaning: The constant 0V
Page: 18
Section: 1
Index: variable

Instruction: delay(foo)
Page: 18
Effect: Totally stop the arduino for foo miliseconds
Chapter: 1
Extra: prog

Name: Breadboard
Definition: A simple prototyping tool that easily allows to wire up simple circuits without having to solder together parts to a custom printed circuit board.
Page: 21
Chapter: 1
Section: 2

Name: Ground bus
Page: 21
Chapter: 1
Section: 2
Notation: The blue line

Q: [...] line is [...]
A: The red; providing power
Page: 21
Chapter: 1
Section: 2

Question: The connected dots are:
Answer: ABCDE and FGHIJ on a single line
Page: 21
Chapter: 1
Section: 2

Name: A polarized element
Definition: An element whose wires have a direction.
Page: 22
Chapter: 1
Section: 2

Name: The anode
Definition: The positive lead.
Page: 22
Chapter: 1
Section: 2

Question: LEDs are mounted
Answer: in series, with a resistor to limit the current.
Page: 22
Chapter: 1
Section: 2

Name: The cathode
Definition: The negative lead.
Page: 22
Chapter: 1
Section: 2

Question: The shorter lead is called
Answer: cathode
Page: 22
Chapter: 1
Section: 2

Name: Light-emitting diode
Page: 22, 23
Chapter: 1
Section: 2
Abbreviation: LED

Question: Current flows
Answer: from positive to negative.
Page: 22
Chapter: 1
Section: 2

Name: A resistor
Definition: Something which restricts the electrical flow
Page: 22
Chapter: 1
Section: 2
Notation: Ri

Name: Diode
Definition: Something which allows current to flows in only one way
Page: 22, 66, 69
Chapter: 1
Section: 2

Name: Ground
Page: 23
Chapter: 1
Section: 2
Notation: GND

Name: Source voltage
Page: 23
Chapter: 1
Section: 2
Notation: nV

Question: When you put in series a led and a resistor, the larger the resistor value,
Answer: the dimmer the LED glows.
Page: 22
Chapter: 1
Section: 2

Name: A load
Definition: Something to use up the energy.
Page: 23
Chapter: 1
Section: 2
Example: A LED

Name: A circuit
Definition: A closed loop with a source of electrical energy and a load.
Page: 23
Chapter: 1
Section: 2

Name: Voltage
Definition: Represents the potential electrical difference between two points.
Page: 23
Chapter: 1
Section: 2

Name: Current
Definition: Flows from a point of higher potential energy to lower potential energy.
Page: 23
Chapter: 1
Section: 2

Name: Resistance
Definition: How easy it is for current to flow.
Page: 23
Chapter: 1
Section: 2
Extra: Hard ?

Name: Ohm
Abbreviation: \(\Omega\)
Chapter: 1
Page: 23
Represents: Unit of measure of resistance
Section: 2

Name: amps
Abbreviation: A
Chapter: 1
Page: 23
Represents: Unit of measure of currents.
Section: 2

Question: Maximal current for LED is
Answer: 20mA
Page: 23
Chapter: 1
Section: 2

Q: [...]=[...]
A: Power; Current*Voltage
Page: 23
Chapter: 1
Section: 2
Name: The power equation

Instruction: const type varName = expr;
Page: 25
Meaning: Execute expr
Assign its value to varName of type type, forbidding to ever change this value
Chapter: 1
Section: 2
Extra: prog

Instruction: for(init; test; incr){
code
}
Page: 26
Effect: Execute init, while test is true executes code and then incr
Language: C
Chapter: 1
Section: 2
Extra: prog

Instruction: analogWrite(pinNumber,voltage);
Page: 27
Effect: Sends voltage*5/255 volts to pinNumber using PMW
Chapter: 1
Section: 2
Variables: voltage between 0 and 255 to ?
Extra: prog

Q: Pins marked by [...] are [...].
A: ~; able to use analogWrite
Page: 27
Chapter: 1
Section: 2

Name: pulse-width modulation
Definition: Simulating having \(n\) volts using \(m\) volts by sending currents \(n/m\)th of the time.
Page: 27, 28
Chapter: 1
Section: 2
Abbreviation: PMW

Name: A floating input pin
Definition: An input pin connected to nothing.
Page: 30
Chapter: 1
Section: 2

Question: Most common pulldown resistor value:
Answer: \(10k\Omega\).
Page: 30
Chapter: 1
Section: 2

Name: A pulldown resistor
Definition: A resistors which links a pin to ground
Page: 30
Chapter: 1
Section: 2
Intuition: When a button is pressed, closing the circuit, it forbid the short-circuit between ground and 5V, while allowing circuit to still be closed when the button is not pressed

Name: A pullup resistor
Definition: A resistors which links a pin to 5V
Page: 30
Chapter: 1
Section: 2

Instruction: if (cond)
{
code1
}
else
{
code2
}
Page: 31
Effect: Execute code1 if cond holds, code2 otherwise
Chapter: 1
Section: 2
Extra: prog

Instruction: digitalWrite(pinNumber,value)
Page: 31
Effect: Test whether pinNumber's value is value
Chapter: 1
Section: 2
Variables: value is LOW or HIGH
Extra: prog

Name: Switch bouncing
Definition: The fact that, when pressed, a button does not directly goes from ground to 5V but bounces between the two during a few ms
Page: 32
Chapter: 1
Section: 2

Question: Debouncing a button:
Answer: Store current button start. After seeing a change, wait 5ms, and then consider that the current button start is the correct one
Page: 33
Chapter: 1
Section: 2

Instruction: return expression;
Page: 34
Effect: Stop the functions and returns the value of expression
Chapter: 1
Section: 2
Extra: prog

Instruction: type functionName(args){
code
}
Page: 34
Meaning: Define a function, named functionName, who returns a value of type type (or nothing if type is void). It takes as parameter args, and, when called, execute code, when args are interpreted by the value with which the function is called
Chapter: 1
Section: 2
Context: Arduino C
Extra: prog

Instruction: functionName(exprs)
Page: 34
Effect: Calls the function functionName with the arguments exprs. If its type is not void, it should return a value.
Chapter: 1
Section: 2
Extra: prog

Name: RGB led
Definition: A led with a single catode, and an anode by color.
Page: 36
Chapter: 1
Section: 2

Name: An analog signal
Definition: A signal which cannot be discretely classified; they vary within a range, theoretically taking on an infinite number of possible values within that range
Page: 43
Chapter: 3
Section: 1

Name: A potentiometer
Definition: variable voltage dividers that look like knobs
Page: 45
Chapter: 3
Section: 1
Abbreviation: A pot

Question: How to branch a pot
Answer: Connect one of the outer pins to ground, the other to 5V, the middle to input 0
Page: 45
Chapter: 3
Section: 1

Instruction: analogRead(P)
Page: 46
Chapter: 3
Section: 1
Returns: 1023*v/(r) where v is the voltage on input P and r the reference value
Extra: prog
Assuming: P's mode is input
Typ: int between 0 and 1023

Instruction: Serial.println(s)
Page: 46
Effect: Print the string s to the serial port and then a newline
Chapter: 3
Section: 1
Extra: prog

Instruction: setup.Serial.begin(b)
Page: 48
Effect: Setup the serial port to a baud rate of b
Chapter: 3
Section: 1
Extra: prog

Name: Baud rates
Chapter: 3
Page: 48
Represents: Number of bits being transmitted by second
Section: 1

Name: Sharp Infrared Proximity Sensor
Definition: Allows to measures the distance between your project and other objects
Page: 50
Chapter: 3
Section: 1

Name: Temperature Sensor
Definition: Allows to measure temperature. 10mV=1degree C
Page: 50
Chapter: 3
Section: 1

-DEFAULT= 5V or 3.3V
-INTERNAL=1.1 or 2.56
-INTERNAL1V1=1.1,
-INTERNAL2V56=2.56
-EXTERNAL= the voltage applied to the AREF pin
Page: 51
Chapter: 3
Section: 1
Name: The possible value for analogReference

Name: Triple Axis Analog Accelerometer
Definition: output an analog value corresponding to each axis of movement: X, Y, and Z (each on a different pin)
Page: 51
Chapter: 3
Section: 1

Name: Dual Axis Analog Gyroscope
Definition: An object whose analog output voltages fluctuate in accordance with angular acceleration around an axis.
Page: 51
Chapter: 3
Section: 1

Name: A resistive voltage divider
Definition: Something which output a voltage that is some fraction of the input voltage
Page: 55
Chapter: 3
Section: 1

Name: The equation for a voltage divider
Definition: \(R_1\) the resistor between input and voltmetre, and
Page: 51
Chapter: 3
Section: 1
Definition2: \(R_2\) the resistor betweer voltmetre and output
Conjdef: with
DefType: \(V_{out}=V_{in}\left(\frac{R_2}{R_1+R_2}\right)\)

Instruction: analogReference(v)
Page: 51
Effect: Set the analog reference pin P to v
Chapter: 3
Section: 1
Extra: prog
Assuming: v is between 0 and 5V

Name: Photoresistor
Definition: A resistor which change resistance depending on the amount of light that hits them
Page: 56
Chapter: 3
Section: 1

Question: How to read the value from a variable resistor
Answer: Use the resistor in a voltage divider, and use its equation
Page: 56
Chapter: 3
Section: 1

Instruction: map(
  value,
  fromLow,
  fromHigh,
  toLow,
  toHigh
)
Page: 56
Effect: Map value, as a point in the interval [fromLow,fromHigh] to the same point, proportionnaly, in the interval [toLow,toHigh]
Chapter: 3
Section: 1
Extra: prog

Instruction: constrain(
  value,
  low,
  high
)
Page: 58
Language: C
Chapter: 3
Section: 1
Returns: the number, closest to value in [low,high]
Extra: prog

Name: Short circuit
Definition: connecting power directly to ground
Page: 64
Chapter: 4

Name: DC motor
Definition: A motor rotating continuously when a DC voltage is applied across it.
Page: 65
Chapter: 4

Question: What controls the speed of a DC motor ?
Answer: The voltage
Page: 65
Chapter: 4

Question: What controls the direction of a DC motor ?
Answer: The direction of the voltage.
Page: 65
Chapter: 4

Name: Brushed DC motor
Definition: A motor with two brushes, whose polarity alternates each half of turns.
Page: 65, wp
Chapter: 4

Question: Advantage of Brushed DC motor on Stepper DC motor ?
Answer: Cheap
Page: 65
Chapter: 4
Answer2: easier to control the speed

Question: Advantage of Stepper DC motor on Brush DC motor ?
Answer: Longer live.
Page: 65
Chapter: 4

Question: What happens if a DC motor is manually turned ?
Answer: It generates current. (Which can damage a circuit)
Page: 65
Chapter: 4

Name: DC motor
Page: 66
Chapter: 4

Name: Bipolar-junction transistor
Definition: A voltage-controlled switch that allows you to inhibit or allow current flow
Page: 66
Chapter: 4
Abbreviation: BJT

Question: Main difficulty in controlling a motor ?
Answer: The voltage needed is higher than what can be given by Arduino, and can damage arduino in case of trouble.
Page: 66
Chapter: 4
Context: Arduino

Question: How to plug a motor ?
Page: 66
Chapter: 4

Question: In , what is the usage of C1 ?
Answer: Avoid noise
Page: 66
Chapter: 4

Question: In , what is the usage of D1 ?
Answer: If the motor is turned by hand,
When motor is turned off, a pick of stored energy flows. It ensures that the current flows in the right direction
Page: 66
Chapter: 4

Question: In , what is the usage of Q1 ?
Answer: Controls using pin 9 whether current can passes and makes the motor turn
Page: 66
Chapter: 4

Question: In , how to control motor's speed ?
Answer: Using PMW to connect/disconnect regularly, using motor inertia to keep a regular speed
Page: 66
Chapter: 4

Question: What happens when a (brush DC) motor is stopped ?
Answer: It generates an inverted voltage spike, because of energy built up and stored in the inductance of the motor coils.
Page: 66
Chapter: 4

Question: What to do when two power sources are used ?
Answer: Uses a common ground, to ensure a common reference.
Page: 68
Chapter: 4

Name: Capacitor
Page: 66, 69
Chapter: 4

Question: In which way the current flows in ?
Answer: From the side with no stripe to the side with the stripe.
Page: 69
Chapter: 4

Question: What happen if the two top branch of a H-bridge are closed
Answer: Short circuit
Page: 72
Chapter: 4

Name: Servo motors
Definition: A motor such that you command them to rotate to a particular angular position and they stay there until you tell them to move to a new position.
Page: 80
Chapter: 4
Example: moving armatures to specific rotations
Name2: Servos
Example2: door locks

Name: Standard Servo motors
Definition: A servos with a fixed range, controlled by a potentiometter
Page: 80
Chapter: 4

Name: Continuous Servo motors
Definition: A servos whose rotation is controlled by the pulse length
Page: 80
Chapter: 4

Name: Linear regulator
Definition: An object which transform a nV input to a mV input, with \(m\le n\).
Page: 80
Chapter: 4

Question: In a linear regulator from n to m volts, what happens of the \(m-n\) other volts ?
Answer: Burned as heat
Page: 80
Chapter: 4

Question: How to connect a linear regulator ?
Answer: Ground similar to the one of the circuit. Everything else separated
Page: 80
Chapter: 4

Typ: Servo
Meaning: The class used to control servos
Page: 80
Chapter: 4
Extra: algoToType
Library: Servo.h

Instruction: s.attach(foo)
Page: prog
80
Effect: State that the servo is on pin foo
Chapter: 4
Variables: s: an element of type servo
Extra: prog
Library: Servo.h

Instruction: s.write(foo)
Page: prog
80
Effect: Put the servo to foo degrees
Chapter: 4
Variables: s: an element of type servo
Extra: prog
Assuming: \(0\le foo<180\)
Library: Servo.h

Question: What does represent the frequency of a sound ?
Answer: The pitch of the sound
Page: 92
Chapter: 5

Question: What does represent the amplitude of a sound ?
Answer: The volume of the sound
Page: 92
Chapter: 5

Instruction: tone(foo, bar, buz)
Page: 95
Effect: play note bar hz during buz on pin foo
Chapter: 5

Instruction: #include foo
Page: 96
Effect: similar to copying here the content of file foo
Context: C
Chapter: 5

Typ: bar foo[n]
Meaning: foo is a variable pointing to a numbered list of n elements of type bar
Page: 99
Chapter: 5

Instruction: foo[bar]
Page: 99
Effect: the bar'th elements of foo
Chapter: 5
Variables: foo an array

Instruction: NOTE_FN
Page: 101
Effect: The note F on N-th octave
Chapter: 5

Instruction: noTone(foo)
Page: 104
Effect: States that no tone should be played anymore on pine foo
Chapter: 5

Question: What is the default baud rate of serial port ?
Answer: 9600
Page: 48
Chapter: 3
Section: 1