Day 5: (Tue Jul 9) Introduction to Electronics

Notes for 2019-07-09. See also the Calendar.

Notes from Day 4

  1. All of the code samples collected together: Lecture Sample Code
  2. The game code template: PinballGame Arduino Sketch
  3. Later we’ll review the 2018 code as written.

Agenda

In-class activities:

  1. Brief lecture on electrical theory
  2. Visual review of basic sensors: switches, photoresistors, photointerruptors.
  3. Visual review of actuators: solenoid, DC motor, hobby servo.
  4. Visual review of tools: DMM, power supply, oscilloscope.
  5. Photointerruptor circuits
  6. Arduino: analogInput(), plotting
  7. DC motor driver module
  8. MOSFET solenoid driver circuit
  9. Last 45 minutes: design scrum for game features.

Lecture code samples

Plotting Analog Data

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
// 1. use the Arduino IDE plotting utility to visualize an analog signal
// 2. demonstrate analogRead()

void setup()
{
   Serial.begin(115200);
}

void loop()
{
  Serial.println(analogRead(0));
}