sensors

Android Camera - app passed NULL surface

匿名 (未验证) 提交于 2019-12-03 08:36:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Whenever I run the cam_thread I get the error "app passed NULL surface". This code supposedly works on the HTC Incredible 1. I've reconfigured it slightly to run on a droid x. However I still get this error. public class Android_Activity extends Activity { Main_thread simulator; ToggleButton togglebutton; EditText ip_text; SensorManager sm = null; SurfaceView view; Sensors_thread the_sensors=null; String IP_address; Android_Activity the_app; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Python 'list indices must be integers, not tuple\" error

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm working on moving a robot around a 2d grid room of 8 x 8, and one part is initialising the sensors which consist of the closest 5 tiles around the robot. self.sensors = [0 for x in xrange(5)] here I'm creating an empty of array of 5 elements. but when I attempt to set the value of sensors like this: if self.heading == 'East': self.sensors[0] = self.room[self.x, self.y-1] self.sensors[1] = self.room[self.x+1, self.y-1] self.sensors[2] = self.room[self.x+1, self.y] self.sensors[3] = self.room[self.x+1, self.y+1] self.sensors[4] = self.room

How to let sensors periodically work?

匿名 (未验证) 提交于 2019-12-03 01:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am currently developing an app in Android which will record sensor data for a fixed length of time for several cycles. For example, I plan to record the data for 10 seconds, and then stop, let the phone rest for 10 seconds, and start record again, ... working in this pattern for 1 hour. My question is, how to let the phone automatically execute this plan? I am currently using code below ( from Android: How to collect sensor values for a fixed period of time? ) , but it only works for one cycle, I have to manually start new cycles after I

linux 下如何获取 cpu 温度

匿名 (未验证) 提交于 2019-12-02 21:59:42
可以通过读取如下路径中的数据来获取cpu的温度信息,不过读取的数据没有经过处理。 cpu0 : cat / sys / class / thermal / thermal_zone0 / temp cpu1 : cat / sys / class / thermal / thermal_zone1 / temp 安装 lm_sensors 软件包: # rpm yum install lm_sensors # deb apt - get install lm - sensors 执行命令 sensors-detect ,进行简单配置,此命令执行后会出现一系列选项,一直yes即可; 执行命令 sensors ,查看cpu的温度。 原文:https://www.cnblogs.com/chuckzhang/p/a067ec85c5037a6d03a56fb443e88494.html

android 4.4 sensor框架

余生长醉 提交于 2019-11-29 19:28:35
推荐文章: 驱动层 1、https://www.cnblogs.com/linhaostudy/p/8303628.html 2、https://www.cnblogs.com/linhaostudy/p/8304017.html hal层 1、https://www.cnblogs.com/linhaostudy/p/8430583.html 高通hal对于不同的芯片提供的接口方式不一样 比如我司的就是将所有的sensor都挂入到global_sensors_list这个链表中 这个链表又是从module->get_sensors_list(module, &subhal_sensors_list);中获取到sensor之后放入到临时创建的 数组中,然后遍历数组,依次挂入到global_sensors_list下(感觉这个做法有点多此一举)。 总而言之:就是调用driver的get_sensors_list这个函数来获取芯片的列表、 来源: https://blog.csdn.net/madannasf/article/details/100899463

HillCrest Sensor HAL

送分小仙女□ 提交于 2019-11-28 20:31:29
1. 抽象定义 Google为Sensor提供了统一的HAL接口,不同的硬件厂商需要根据该接口来实现并完成具体的硬件抽象层,Android中Sensor的HAL接口定义在:hardware/libhardware/include/hardware/sensors.h, 其中定义了几个数据类型: sensor_t - 包含传感器相关信息 sensors_module_t - 传感器硬件模块类型 sensors_event_t - 传感器事件 sensors_poll_device_t - 传感器抽象设备类型 HAL实现必须完成下面的函数接口: get_sensors_list - 返回所有传感器的列表 activate - 启动或停止传感器 batch - 设置传感器的参数,如采样率和最大报告延迟 setDelay - 仅用于 1.0 版本的 HAL,设置指定传感器的采样率 flush - 刷写指定传感器的 FIFO 并在完成后报告刷写完成事件 poll - 返回可用的传感器事件 1.1 sensor type sensor type的定义如下: [sensors-base.h] enum { SENSOR_TYPE_META_DATA = 0, SENSOR_TYPE_ACCELEROMETER = 1, SENSOR_TYPE_MAGNETIC_FIELD = 2, SENSOR