步态检测

听****雨 UID.1308748
2016-04-30 发表

本帖最后由 听荷留雨 于 2016-4-30 16:08 编辑

每个人走路的姿势都不一样,所以在有些电影场景中,会通过步态的合核实来者身份。然后这里通过检测走路时脚掌的受力这一方面实现。

所需工具:

***附件停止解析***

首先得第一件事情是如何布局传感器

***附件停止解析***

***附件停止解析***

***附件停止解析***

***附件停止解析***

***附件停止解析***

***附件停止解析***

***附件停止解析***

是不是最后看起来和鞋垫一样

接下来就是传感器,蓝牙模块和Arduino之间的连接

***附件停止解析***

***附件停止解析***

最后结果

***附件停止解析***

***附件停止解析***


代码:[mw_shl_code=c,true]/*
Copyright(c) Microsoft Open Technologies, Inc. All rights reserved.

The MIT License(MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

// Include the ArduinoJson library, a dependency
#include <ArduinoJson.h>

// VirtualShield is the core of all shields
#include <VirtualShield.h>
// Text is to display text onscreen.
#include <Text.h>

// Geolocator is for GPS use
#include <Geolocator.h>

// Instantiate the shields
VirtualShield shield;
Text screen = Text(shield);
Geolocator gps = Geolocator(shield);

int sensor[4];
int sensorstate[4];
int trigger[4];
int count[4];

// Callback event for GPS events
void gpsEvent(ShieldEvent* shieldEvent)
{
// If there is a sensor error (errors are negative)... display message
if (shieldEvent->resultId < 0) {
screen.printAt(3, "Sensor doesn't exist");
screen.printAt(4, "or isn't turned on.");

screen.printAt(6, "error: " + String(shieldEvent->resultId));
return;
}

String lat = String("Lat: ") + String(gps.Latitude);
String lon = String("Lon: ") + String(gps.Longitude);

// Print the latitude and longitude to the screen.
screen.printAt(11, lat);
screen.printAt(12, lon);
}

void refresh(ShieldEvent* shieldEvent)
{
// put your refresh code here
// this runs whenever Bluetooth connects, whenever the shield.begin() executes, or the 'refresh' button is pressed in the app:
screen.clear();
screen.printAt(1, "Tack your Gait!");
screen.printAt(4, "Gait Count:");
screen.printAt(10, "GeoLocation:");
}

void setup()
{
// set up virtual shield events:
shield.setOnRefresh(refresh);

// begin the shield communication (also calls refresh()).
shield.begin(); //assumes 115200 Bluetooth baudrate

// Connect the events to the shields.
screen.clear();
screen.printAt(2, "Basic GPS Lookup");

// When the GPS retrieves values, call this function: gpsEvent()
gps.setOnEvent(gpsEvent);

// put your setup code here, to run once:
trigger[0]=360;
trigger[1]=200;
trigger[2]=320;
trigger[3]=200;
}

long nextMinute = 60000;
int beatBPM[4];

void loop()
{
shield.checkSensors();

// put your main code here, to run repeatedly:
if (millis() > nextMinute) {
nextMinute = millis() + 60000;
for (int x=0; x <=3; x++){
beatBPM[x]=count[x]/(nextMinute/60000);
String beatscreen = String("BPM Sensor ") + String(x) + String(": ") + String(beatBPM[x]);
screen.printAt(x+14, beatscreen);
}

}
for (int x=0; x <= 3; x++){
sensor[x]=analogRead(x);
if (sensor[x] > trigger[x] && sensorstate[x]==0)
{
count[x]=count[x]+1;
sensorstate[x]=1;
// Get the GPS coordinates (send the event to request GPS).
gps.get();
String sensorscreen = String("Sensor ") + String(x) + String(": ") + String(count[x]);
screen.printAt(x+5, sensorscreen);
}
if (sensor[x] < trigger[x] && sensorstate[x]==1)
{
sensorstate[x]=0;
}
}
}[/mw_shl_code]
via:hackster

标签: 检测

敬告:
为防止不可控的内容风险,本站已关闭新用户注册,新贴的发表及评论;
你现在看到的内容只是互联网用户曾经发表的言论快照,仅用于老用户留存纪念,且仅与科技行业相关,全部内容不代表本站观点及立场;
本站重新开放前已针对包括用户隐私、版权保护、信息安全、国家政策在内的各种互联网法律法规要求,执行了隐患内容的自查、屏蔽和删除;
本站目前所属个人主体,未有任何盈利安排与计划,且与原WFUN.COM所属公司不存在任何关联关系;
如果本帖内容或者相关资源侵犯到您的合法权益,或者您认为存在问题,那么请您务必点此举报或投诉!
全部回复:
7nanren7 UID.1143004
2016-04-30 使用 Lumia 640 XL 回复

这个就是传说中的的大神啊!

fw374164352 UID.936056
2016-04-30 使用 Lumia 950 回复

可以的。。。

newsmanager UID.978056
2016-04-30 回复

6666666666666666

zh****vi UID.2829117
2016-05-31 回复

NB......{:3_93:}

q2****09 UID.2826059
2016-05-31 回复

{:3_94:}{:3_94:}

本站使用Golang构建,点击此处申请开源鄂ICP备18029942号-4联系站长投诉/举报