TI Sensortag, how to use push buttons?

2019-05-29 05:00发布

I am working with the new TI Sensortag. I'm trying to do a simple iOS app that reads the state of those buttons. I've found a lot of guide, tutorial etc. about using Sensortag's sensors (humidity, IR Temperature, ...) but no one talks about push buttons on his top. Has anyone an idea about them?

Tank you very much

Reda

P.S. I'm using an iPhone 5

3条回答
别忘想泡老子
2楼-- · 2019-05-29 05:31

The default behavior (if not reprogrammed) for the side button is:

When not connected, this button is used to toggle advertising on and off. In pushed when in a connection, the connection is dropped, sensors reset and all data values are set to zero >(Soft reset).

The hole in the front is not an actual button but an opening for the IR temperature sensor to be able to do remote temperature measurements.

Source: http://processors.wiki.ti.com/index.php/SensorTag_User_Guide

查看更多
你好瞎i
3楼-- · 2019-05-29 05:44

Take a look at YmsCoreBluetooth, a framework I wrote to build iOS CoreBluetooth apps. I have an example of it working with a TI SensorTag and it supports the push buttons.

http://kickingvegas.github.io/YmsCoreBluetooth/

查看更多
疯言疯语
4楼-- · 2019-05-29 05:51

0xFFE1 SK_KEY_PRESSED GATT_PERMIT_READ Left/Right Keys, Side key as Bit 2 in test mode only.

http://processors.wiki.ti.com/index.php/File:BLE_SensorTag_GATT_Server.pdf

Keys are list on the schematic as "push-button carbon" S2 and S3 and access is through cut-away inserts in the clear plastic cover and via raised bumps (I don't think it's Braille but that would have been a nice touch) in the "lipstick red" case. Connect via the BLE Device monitor and run in the test mode to see if they are detected as all three switches are checked in this mode and the events are displayed.

查看更多
登录 后发表回答