Professional Documents
Culture Documents
w11t2 Assignment
w11t2 Assignment
Getting Started
Materials Needed:
● Arduino Board (Arduino Uno or Nano)
● Common cathode RGB LED (or three separate LEDs for red, green, and
blue)
● 3 x 220-330 ohm resistors
● Breadboard or Custom PCB
● Jumper Wires
● 5V Power Supply
● Smartphone or Computer for Control
Process
EXAMPLE CODE:
const int redPin = 9;
const int greenPin = 10;
const int bluePin = 11;
int delayTime = 10;
void setup() {
pinMode (redPin, OUTPUT);
pinMode (greenPin, OUTPUT);
pinMode (bluePin, OUTPUT);
}
void loop() {
for (int i = 0; i < 256; i++) {
analogWrite (redPin, i);
delay (delayTime);
}