- 浏览: 1442915 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (691)
- linux (207)
- shell (33)
- java (42)
- 其他 (22)
- javascript (33)
- cloud (16)
- python (33)
- c (48)
- sql (12)
- 工具 (6)
- 缓存 (16)
- ubuntu (7)
- perl (3)
- lua (2)
- 超级有用 (2)
- 服务器 (2)
- mac (22)
- nginx (34)
- php (2)
- 内核 (2)
- gdb (13)
- ICTCLAS (2)
- mac android (0)
- unix (1)
- android (1)
- vim (1)
- epoll (1)
- ios (21)
- mysql (3)
- systemtap (1)
- 算法 (2)
- 汇编 (2)
- arm (3)
- 我的数据结构 (8)
- websocket (12)
- hadoop (5)
- thrift (2)
- hbase (1)
- graphviz (1)
- redis (1)
- raspberry (2)
- qemu (31)
- opencv (4)
- socket (1)
- opengl (1)
- ibeacons (1)
- emacs (6)
- openstack (24)
- docker (1)
- webrtc (11)
- angularjs (2)
- neutron (23)
- jslinux (18)
- 网络 (13)
- tap (9)
- tensorflow (8)
- nlu (4)
- asm.js (5)
- sip (3)
- xl2tp (5)
- conda (1)
- emscripten (6)
- ffmpeg (10)
- srt (1)
- wasm (5)
- bert (3)
- kaldi (4)
- 知识图谱 (1)
最新评论
-
wahahachuang8:
我喜欢代码简洁易读,服务稳定的推送服务,前段时间研究了一下go ...
websocket的helloworld -
q114687576:
http://www.blue-zero.com/WebSoc ...
websocket的helloworld -
zhaoyanzimm:
感谢您的分享,给我提供了很大的帮助,在使用过程中发现了一个问题 ...
nginx的helloworld模块的helloworld -
haoningabc:
leebyte 写道太NB了,期待早日用上Killinux!么 ...
qemu+emacs+gdb调试内核 -
leebyte:
太NB了,期待早日用上Killinux!
qemu+emacs+gdb调试内核
ios设备中有的加速计可以测量出加速度和重力。陀螺仪可用于确定设备的方向与每条坐标轴之间的夹角,可用于读取描述设备围绕其轴的旋转的值。
添加CoreMotion.framework.
以下为例子代码:
添加CoreMotion.framework.
以下为例子代码:
#import <UIKit/UIKit.h> #import <CoreMotion/CoreMotion.h> @interface ViewController : UIViewController @property (strong, nonatomic) CMMotionManager *motionManager; @property (weak, nonatomic) IBOutlet UILabel *accelerometerLabel; @property (weak, nonatomic) IBOutlet UILabel *gyroscopeLabel; @end
#import "ViewController.h" @interface ViewController () @end @implementation ViewController @synthesize motionManager; @synthesize accelerometerLabel; @synthesize gyroscopeLabel; - (void)viewDidLoad { [super viewDidLoad]; self.motionManager = [[CMMotionManager alloc] init]; NSOperationQueue *queue = [[NSOperationQueue alloc] init]; //加速计 if (motionManager.accelerometerAvailable) { motionManager.accelerometerUpdateInterval = 1.0/10.0; [motionManager startAccelerometerUpdatesToQueue:queue withHandler:^(CMAccelerometerData *accelerometerData,NSError *error){ NSString *labelText; if (error) { [motionManager stopAccelerometerUpdates]; labelText = [NSString stringWithFormat:@"Accelerometer encountered error: %@",error]; }else{ labelText = [NSString stringWithFormat:@"加速计\nx: %+.2f\ny: %+.2f\nz: %+.2f",accelerometerData.acceleration.x,accelerometerData.acceleration.y,accelerometerData.acceleration.z]; } [accelerometerLabel performSelectorOnMainThread:@selector(setText:) withObject:labelText waitUntilDone:NO]; }]; }else{ accelerometerLabel.text = @"This device has no accelerometer."; } //陀螺仪 if (motionManager.gyroAvailable) { motionManager.gyroUpdateInterval = 1.0/10.0; [motionManager startGyroUpdatesToQueue:queue withHandler:^(CMGyroData *gyroData,NSError *error){ NSString *labelText; if (error) { [motionManager stopGyroUpdates]; labelText = [NSString stringWithFormat:@"Gyroscope encountered error: %@",error]; }else{ labelText = [NSString stringWithFormat:@"陀螺仪\nx: %+.2f\ny: %+.2f\nz: %+.2f",gyroData.rotationRate.x,gyroData.rotationRate.y,gyroData.rotationRate.z]; } [gyroscopeLabel performSelectorOnMainThread:@selector(setText:) withObject:labelText waitUntilDone:NO]; }]; }else{ gyroscopeLabel.text = @"This device has no gyroscope"; } } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } @end
发表评论
-
xl2tp 备份
2019-09-24 16:25 5722019年9月24日更新: 注意,需要开启firewall ... -
sdl笔记
2019-01-31 17:19 683sdl教程教程 https://github.com/Twin ... -
tinyemu
2019-01-24 17:59 1395参考https://bellard.org/jslinux/t ... -
aws搭建xl2tp给iphone使用
2018-12-26 21:37 18012019年12月26日 可以参考原来的配置 https:// ... -
facebook的socketrocket总结
2018-03-19 13:36 1377最近看了开源的网易的demo https://netease. ... -
consul的基本使用
2017-06-27 11:13 1349### 安装 [centos7上consul的安装](ht ... -
lvs的helloworld
2017-06-13 20:36 557###################lvs######### ... -
系统调用的helloworld
2017-05-04 16:14 558《2.6内核标准教程》 p293 #include < ... -
bitcoin和cgminer的安装
2017-04-05 22:45 1918参考 http://blog.csdn.net/rion_ch ... -
ceph安装和常用命令
2017-03-21 21:55 910/etc/hosts ssh-keygen ssh-copy- ... -
mobile terminal 笔记
2016-12-02 15:35 544找出旧的iphone4 越狱之后可以变个小操作系统 mobi ... -
socket基础和select(python)
2016-06-14 17:21 1756上接 c语言的socket基础ht ... -
socket基础(c语言)
2016-06-14 16:45 937不使用select 普通的基础socket连接,对多个客户端的 ... -
ffmpeg+nginx 的直播(2,直播摄像头和麦克风)
2016-05-28 20:21 4254假设我的服务器是centos7 192.168.139.117 ... -
ffmpeg+nginx 的直播(1,直播播放的视频文件)
2016-05-26 17:11 651564位操作系统centos7 ############ 1.一 ... -
socat和netcat(nc)
2016-04-29 22:36 1670转 原文链接: http://www.wenquan.name ... -
neutron基础九(qemu nat网络)
2016-02-06 17:21 1550接上基础八,kvm透传nested忽略 1.在主机ce ... -
neutron基础八(qemu 桥接网络)
2016-02-06 13:13 1477qemu的桥接和nat的qemu启动命令是一样的,但是后续的脚 ... -
neutron基础七(qemu tap)
2016-02-02 17:02 966使用qemu 建立个虚拟机 然后用tap设备, 根据基础六,t ... -
neutron基础六(bridge fdb)
2016-01-28 18:30 2126转发表 在三台机器上建立三个namespace 192.16 ...
相关推荐
ios运用加速计与陀螺仪进行计步 并调取iPhone手机健康软件跑步数据 高德地图定位 大头针标注当前位置 并进行实时插入大头针显示地理位置编码后的格式化地理信息
Core Motion框架从iOS设备的板载硬件(包括加速计,陀螺仪,计步器,磁力计和气压计)报告与运动和环境有关的数据。您可以使用此框架访问硬件生成的数据,以便您可以在应用程序中使用它。例如,游戏可能使用加速度计...
指纹识别、运动传感器、加速计、环境光感、距离传感器、磁力计、陀螺仪。
运用加速计和陀螺仪 使用icloud服务来增强你的应用 vandad nahavandipoor从事软件开发工作多年,使用过cocoa,cocoa touch,assembly,delphi和.net等多种语言。在一家移动支付方案全球领导者公司工作期间,他...
《iOS 5基础教程》 中文名iOS 5基础教程 外文名Beginning iOS 5 Development: ...第19章 陀螺仪和加速计 528 第20章 iPhone照相机和照片库 553 第21章 应用程序本地化 563 第22章 未来之路 579
该插件的是使用运动检测API(使用加速计,陀螺仪和磁力计)来检测设备何时处于移动和静止状态。 当检测到设备正在移动时,插件将根据配置的distanceFilter (米)自动开始记录位置。 当检测到设备处于静止状态时,...
该插件的是使用运动检测API(使用加速计,陀螺仪和磁力计)来检测设备何时处于移动和静止状态。 当检测到设备正在移动时,插件将根据配置的distanceFilter (米)自动开始记录位置。 当检测到设备处于静止状态时,...
该插件的是使用运动检测API(使用加速计,陀螺仪和磁力计)来检测设备何时处于移动和静止状态。 当检测到设备正在移动时,插件将根据配置的distanceFilter (米)自动开始记录位置。 当检测到设备处于静止状态时,...
有鉴于此,提出一轻便型意法半导体(ST Microelectronic)穿戴手环方案,此方案结合了省电型STM32L微控器、省电型蓝牙Bluenrg-MS网络处理器、STC3115 电源管理 IC、LSM6DS3 iNemo module:3轴加速计及陀螺仪、LIS3MDL e...
支持 10 个低功耗传感器,包括环境光、数字麦克风、磁传感器、湿度、压力、加速计、陀螺仪、磁力计、物体温度以及环境温度 超低功耗,通过单个纽扣电池提供数年的电池寿命,并通过高性能 ARM:registered: Cortex:...
支持 10 个低功耗传感器,包括环境光、数字麦克风、磁传感器、湿度、压力、加速计、陀螺仪、磁力计、物体温度以及环境温度 超低功耗,通过单个纽扣电池提供数年的电池寿命,并通过高性能 ARM:registered: Cortex...
陀螺仪可实现动作控制、游戏和GPS功能 加速计可实现冲击识别和震动监控功能 电子罗盘可实现地图旋转、位置检测和动作激活应用的功能 晴雨表可实现测高、气象设备和智能手表功能 湿度和温度计可实现家庭自动化、空调...