7673| 4
|
[对决赛] love+情侣感情增进可穿戴智能设备 |
本帖最后由 imlvhanlin 于 2015-9-30 23:45 编辑 love+情侣感情增进可穿戴智能设备 项目介绍: 这是一个为了增进情侣和亲人之间感情而研发的可穿戴智能交互设备,有不同的佩戴方式可以选择,其功能是定时提醒情侣应该和爱人进行亲密的互动,因为现代人平时工作繁忙疏于和对方交流,久而久之就会产生家庭的矛盾和情感的危机,有了定时提醒的功能就会时刻想到对方,让亲密形成一种习惯,从而让家庭更加和谐,爱情更加甜蜜长久。 视频介绍: 硬件设备介绍: intel Edison 开发板 磁力传感器 LED灯 微型振动马达 代码: #define uchar unsigned char //#define uint unsigned int #define LedPin 2 #define BeepPin 3 #define MagnetPin 4 uchar magnetVal=0; uchar oldMagnetVal=0; int number = 0; void setup() { Serial.begin(9600); pinMode(LedPin,OUTPUT); pinMode(BeepPin,OUTPUT); pinMode(MagnetPin,INPUT); number = 1; } void loop() { FunMagnetScan(); } void FunMagnetScan() { magnetVal=digitalRead(MagnetPin); if((magnetVal==LOW)&&(oldMagnetVal==LOW)) //SLEEP { digitalWrite(LedPin,LOW); digitalWrite(BeepPin,LOW); } if((magnetVal==HIGH)&&(oldMagnetVal==LOW)) //START { digitalWrite(LedPin,HIGH); digitalWrite(BeepPin,LOW); } if((magnetVal==LOW)&&(oldMagnetVal==HIGH)) //STOP { digitalWrite(LedPin,HIGH); delay(3000); digitalWrite(LedPin,LOW); digitalWrite(BeepPin,HIGH); delay(1000); digitalWrite(BeepPin,LOW); delay(1000); digitalWrite(BeepPin,HIGH); delay(1000); digitalWrite(BeepPin,LOW); delay(1000); digitalWrite(BeepPin,HIGH); delay(1000); digitalWrite(BeepPin,LOW); Serial.println(number); number ++ ; } if((magnetVal==HIGH)&&(oldMagnetVal==HIGH)) //USING { digitalWrite(LedPin,HIGH); digitalWrite(BeepPin,LOW); // Serial.println("1"); } oldMagnetVal=magnetVal; //Serial.println("1"); } |
© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed