Jacqueline Chen
Industrial design 6
DNH603_19se2
Arduino Workshop #3
• More loops
• Analog sensors
• Timing stuff (without delay!)
• Types: their uses and limitations
• Designing code examples
• Arrays
• i2c communication
Circuit1:
Task
switch( variable ) {
case value1:
//do something clever
break;
case value2:
//do something clever
break;
}
Switch…case
• 1x 400 Tie Point Interlocking Solderless Breadboard - Crystal
• 1x DFRduino UR3
• 1x USB Cable
• 1x Red & 1x Black Jumper Cables M/M
Code
Circuit 2:
Task
Using analogue sensors
• 1x 400 Tie Point Interlocking Solderless Breadboard - Crystal
• 1x DFRduino UR3
• 1x USB Cable
• 1x Red & 1x Black & 1x Green Jumper Cables M/M
• 1x Ambient light sensor
• 1x Resistor 1K
Code
Circuit 3:
Task
int time = millis();
• Create a new sketch.
• Add serial begin
• Add the above line
• Print it to the serial port
Timing Things
• 1x 400 Tie Point Interlocking Solderless Breadboard - Crystal
• 1x DFRduino UR3
• 1x USB Cable
• 1x Red & 1x Black & 1x Green Jumper Cables M/M
• 1x Ambient light sensor
• 1x Resistor 1K
Code
Circuit 4:
Task
• Plug a wire into A0. Let it hang loose.
Serial Plotter
• 1x 400 Tie Point Interlocking Solderless Breadboard - Crystal
• 1x DFRduino UR3
• 1x USB Cable
• 1x Red Jumper Cables M/M
Code
Circuit 5:
Arrays – smoothing
• 1x 400 Tie Point Interlocking Solderless Breadboard - Crystal
• 1x DFRduino UR3
• 1x USB Cable
• 1x Red Jumper Cables M/M
Code