“Microduino Butterfly Light”的版本间的差异
(Created page with "{| style="width: 800px;" |- | ==Outline== *Project: Butterfly light *Purpose: Butterfly light is a touch control color-changing music light. *Difficulty: Middle-level *T...") |
(→Program Download) |
||
第153行: | 第153行: | ||
===Program Download=== | ===Program Download=== | ||
− | *Make sure you build Microduino IDE, or you can refer to: | + | *Make sure you build Microduino IDE, or you can refer to:[[Microduino Getting start]]. |
*Make there is _99_LCD_NeoPixel library in IDE. | *Make there is _99_LCD_NeoPixel library in IDE. | ||
*Open the downloaded program and select the right board to download after compiling. | *Open the downloaded program and select the right board to download after compiling. | ||
− | *After the download, you can test whether the function mentioned above is right or not by the Touch sensor. Meantime, you need to notice which LED light the Touch sensor corresponds to. | + | *After the download, you can test whether the function mentioned above is right or not by the Touch sensor. Meantime, you need to notice which LED light the Touch sensor corresponds to. |
==Overall Assembling== | ==Overall Assembling== |
2015年2月6日 (五) 07:01的最新版本
目录Outline
Team Introduction
| ||||||||||||||||||||||||||||||||||||
Bill of Material
DocumentProgram download: Butterfly_light 3D model download: 文件: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 |