Difference between revisions of "Microduino Butterfly Light"
From Microduino Wiki
(→Program Download) |
(→Overall Assembling) |
||
Line 160: | Line 160: | ||
==Overall Assembling== | ==Overall Assembling== | ||
*Fixate the light and the touch sensor on the outside of the 3D battery. | *Fixate the light and the touch sensor on the outside of the 3D battery. | ||
− | [[File: | + | [[File:setup_3d_light01.png|600px|center|thumb]] |
− | [[File: | + | [[File:setup_3d_light02.png|600px|center|thumb]] |
*Wrap the battery with a beautiful exterior. | *Wrap the battery with a beautiful exterior. | ||
− | [[File: | + | [[File:setup_3d_pagef.png|600px|center|thumb]] |
*Fixate the loudspeaker on the base and then get it fixated with the battery. | *Fixate the loudspeaker on the base and then get it fixated with the battery. | ||
Line 172: | Line 172: | ||
[[File:setup_3d_ok1.jpg|600px|center|thumb]] | [[File:setup_3d_ok1.jpg|600px|center|thumb]] | ||
[[File:setup_3d_ok2.jpg|600px|center|thumb]] | [[File:setup_3d_ok2.jpg|600px|center|thumb]] | ||
+ | |||
==Notice== | ==Notice== | ||
*Since Audio adopts Serial 1 by default, please initialize Serial 1: “AUDIO_PORT.begin(9600);” | *Since Audio adopts Serial 1 by default, please initialize Serial 1: “AUDIO_PORT.begin(9600);” |
Revision as of 02:00, 14 December 2015
ContentsOutline
Team Introduction
| ||||||||||||||||||||||||||||||||||||
Bill of Material
DocumentProgram download: Butterfly_light 3D model download: File:3D-Butterfly light.zip Build 3D ModelThe model adopts buttery shape. Build Hardware Circuit
Prepare Audio
Software DebuggingProgram Description
int sensor_pin[7]=
{
4,8,10,12,A0,A2,A6
};
#define PIN 6
Adafruit_NeoPixel strip = Adafruit_NeoPixel(7, PIN, NEO_GRB + NEO_KHZ800);
for(int a=0;a<7;a++)
{
{
if(key_get(sensor_pin[a],1)) //When triggered,
{
//colorWipe(strip.Color(255, 255, 0), 10);
sensor_vol_cache[a]++; //Counting
// Serial.print("+");
if(sensor_vol_cache[a]>3)
sensor_vol_cache[a]=3;
{
colorWipe(color[8], a);
num=a;
audio_choose(a+1);
audio_play();
colorWipe(color[0], a);
}
time1[a]=millis();
}
if(millis()-time1[a]>500 && sensor_vol_cache[a]!=0) //Just start it and delay for one second or more, and the scan is ended.
{
if(sensor_vol_cache[a]==1)
{
colorWipe(color[0], a);
Serial.println("LED_OFF");
}
else if(sensor_vol_cache[a]==2)
{
colorWipe(color[8], a);
}
else
{
randomSeed(millis()%1000);
sensor_vol[a]=random(1,7);
Serial.println("");
Serial.print("num:");
Serial.print(a);
Serial.print(":");
Serial.print(sensor_vol[a]);
colorWipe(color[sensor_vol[a]], a);
}
sensor_vol_cache[a]=0; //Return to zero and wait for the next scan.
}
}
} Program Download
Overall Assembling
Notice
Video |