lec 2 Flashcards
what does a pull up/pull down resistor do
ensure the input voltage is maintained at +5 volts or ground
WHEN/ what device would a pull up or down resistor be used
when using digital pin as input in Arduino
WHY would you use a pull up or down resistor
voltage level appearing at that input will be unpredictable
what instruction would you issue when using digital line
pinMode (pin_number , INPUT);
what is the pull up pinmode() instruction
pinMode (pin_number , INPUT_PULLUP);
what is the advantage of having 3 dedicated ports on Arduino, and what are these ports called
memory, speed and control
these ports are called: port B, port C and port D
what Adrunio pins does Port B use?
digital pins D8 to pin D13
what Adruino pins does Port C use?
uses analogue pins A0 to A5
what Adruino pins does Port D use?
uses digital pins D0 to pin D7
In any programming, or scripting language functions are an extremely powerful feature with
a significant number of benefits. what are they? (6)
break down program into modules, creating a structured program.
Reduce size of a program by eliminating duplication of code.
Make debugging easier.
Simplify the task of updating/modifying a program.
Make a program easier to read.
Permit the use of local variables
what must all sketches have built in?
function if setup() and loop()
what are the positioning of components in a sketch (5)
void setup() { }
void loop() { }
function 1() { }
function 2() { }
function n() { }
how are functions outside setup() and loop() presented in sketch (4)
appropriate function name preceded by the data type function will return. then set of parentheses.
what is a parenthesis
used to pass one,
or more bits of information to the inner workings of the function in the form of variables.