8846| 10
|
[项目] 此灯泡非彼灯泡 Arduino项目教程 |
It's not a light bulb, it's three LEDs attached to what (sort of) looks like a light bulb. All controlled by a mini-touch kit. 这不是一个灯泡,他呀,他至少不是普通的灯泡。哈哈,他只是一个长得很像灯泡的LED创客项目。它的主要受控于Mini Touch Kit。 Hardware components 硬件清单: DFRduino UNO R3 x 1 微型触摸传感器 x 1 LED(3毫米)x 3 Schematics 制作: These two dimensional fluorescent bulbs are actually three white LEDs. The 'bulb' is a laser cut and engraved piece of acrylic. Stuck to one side of the acrylic is a piece of sticky copper, which is connected to a touch sensor. The light turns on with a simple touch, and off again with another touch. All the electronics are contained in the box base, with a hole for the AB to USB cable to plug into a wall transformer or other USB power source. 在这里看到的二维荧光灯实际上就是三个白色LED。'灯泡'是激光切割后又进行了雕刻的透明亚克力板。“灯泡”下面底座部分的一面亚克力板上贴着不干胶铜箔 (这东西···我们的微型触摸传感器有配套卖的),把这一部分连接到触摸传感器。就可以通过简单的触摸来打开“灯泡”,想关上它的话只要再触摸一次。所有电子元件都放在了在底盘的盒子中,并且需要在盒子边上会有一个用来让USB数据线通过而预留的孔。 Schematics 连线图: Code 代码: [mw_shl_code=applescript,true]//Maddy McGee int light; int sensor; int lastVal; boolean on; void setup(){ light = 2; sensor = 14; Serial.begin(9600); Serial.println("Start"); pinMode(light,OUTPUT); pinMode(sensor,INPUT); lastVal = 0; on = false; } void loop(){ int val = digitalRead(sensor); if(lastVal==0 && val==1) on= !on; if(on) digitalWrite(light,HIGH); else digitalWrite(light,LOW); Serial.println(val); lastVal = val; }[/mw_shl_code] 项目制作者:Maddy 翻译:KIKI(如翻译有错,请提出) |
© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed