behrooz66
Published © GPL3+

Lego Castle & Arduino :)

Just a little pandemic boredom product!

BeginnerShowcase (no instructions)369
Lego Castle & Arduino :)

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
5 mm LED: Yellow
5 mm LED: Yellow
×1
Resistor 100 ohm
Resistor 100 ohm
×1

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)
Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Schematics

Code

Light Flickering

C/C++
const int light1Pin = 3;
const int light2Pin = 5;

void setup() {
	pinMode(light1Pin, OUTPUT);
	pinMode(light2Pin, OUTPUT);
}

void loop() {
  int light1Level = random(50, 256);
  analogWrite(light1Pin, light1Level);
  int light2Level = random(50, 256);
  analogWrite(light2Pin, light1Level);
  delay(125);
}

Credits

behrooz66

behrooz66

0 projects • 11 followers

Comments