Eric Chen
Created September 13, 2015

Homework 01: Getting Started

Folding paper and plugging wires.

Showcase (no instructions)29
Homework 01: Getting Started

Story

Read more

Schematics

Circuit 1

Circuit 2

Code

Circuit_01

C/C++
Flash a LED every second.
void setup() {
  pinMode(13, OUTPUT);
}


void loop() {
  digitalWrite(13, HIGH);
  delay(1000);
  digitalWrite(13, LOW);
  delay(1000);
}

Circuit_02

C/C++
Flashing an LED with a potentiometer
int sensorPin = 0;
int ledPin = 13;

void setup() {
  pinMode(ledPin, OUTPUT);
}


void loop() {
  int sensorValue;
  sensorValue = analogRead(sensorPin);    
  digitalWrite(ledPin, HIGH);
  delay(sensorValue);
  digitalWrite(ledPin, LOW);
  delay(sensorValue);
}

Credits

Eric Chen
9 projects • 2 followers
EECS student at UC Berkeley
Thanks to SparkFun Electronics.

Comments