Grant
Published © LGPL

Linkit building prototype showcase lights

This is a project that shows you how to make cool lights to show off a building prototype.

EasyFull instructions provided15 minutes102

Things used in this project

Hardware components

LinkIt Smart 7688 Duo
MediaTek Labs LinkIt Smart 7688 Duo
×1
rgb led (genaric)
×1
Female/Female Jumper Wires
Female/Female Jumper Wires
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

img_0048_nr6zK9GBCB.JPG

Img 0048 nr6zk9gbcb

img_0046_hRYAzBjSmj.JPG

Img 0046 hryazbjsmj

img_0051_8aJFlqYePt.JPG

Img 0051 8ajflqyept

Code

color fade code

Arduino
const int r = 9;
const int g = 10;
const int b = 11;

int re = 0;
int ge = 255;
int be = 0;


void setup() {
  pinMode(r, OUTPUT);
  pinMode(g, OUTPUT);
  pinMode(b, OUTPUT);

  analogWrite(r, 0);
  analogWrite(g, 0);
  analogWrite(b, 255);

  while (re < 255) {
    re++;
    ge--;
    analogWrite(r, re);
    analogWrite(g, ge);
    analogWrite(b, be);
    delay(20);
  }

}

void loop() {
  
  while (ge < 255) {
    ge++;
    re--;
    analogWrite(r, re);
    analogWrite(g, ge);
    analogWrite(b, be);
    delay(20);
  }

  while (be < 255) {
    be++;
    ge--;
    analogWrite(r, re);
    analogWrite(g, ge);
    analogWrite(b, be);
    delay(20);
  }

  while (re < 255) {
    re++;
    be--;
    analogWrite(r, re);
    analogWrite(g, ge);
    analogWrite(b, be);
    delay(20);
  }

}

Credits

Grant

Grant

12 projects • 32 followers
DIY technology hobbyist
Contact

Comments

Add projectSign up / Login