16. Sensor)

Source: Internet
Author: User

1. What is a sensor?

A sensor is a physical device or biological organ that can detect and feel external signals, physical conditions (such as light, heat, humidity), or chemical components (such as smoke ), and transmit the information to other devices or organs. The definition of the sensor in the national standard GB7665-87 is: "A device or device that can feel the specified measurement and convert to available signals according to certain rules, usually composed of sensitive components and conversion components ". A sensor is a detection device that can sense the information to be measured and convert the information to an electrical signal or other forms of information output according to certain rules, to meet the requirements of information transmission, processing, storage display, recording and control. It is the first step to achieve automatic detection and automatic control.

 

Ii. Sensor category

Classified by measured physical quantity, which can be divided

Displacement sensors,

Speed Sensor,

Accelerometer,

Pressure sensors,

Temperature sensors,

Photosensitive sensors,

Acoustic sensors, etc.

There are also many extensions: Iris fingerprints ......

 

3. Functions of Sensors

Example:

What type of sensors are used for the automatic flushing function in public toilets and how to implement automatic flushing?

What type of sensors are used for the automatic sprinkler function in the building and how to implement automatic sprinkler.

 

4. Android sensor development

(1) sensing types supported by Android

Gyroscope sensor. type_gyroscope

Acceleration Sensor. type_accelerometer

Optical sensor. type_light

Temperature sensing sensor. type_temperature

Sensor. Orientation

Magnetic field sensing sensor. type_magnetic_field

Proximity sensor. type_proximity

(2) sensormanager class

(3) sensor class

(4) sensorevent class

(5) Development Process

A. Obtain the system service sensor_service and return sensormanager.

B. Obtain the sensor type object instance through sensormanager.

C. Declare a sensoreventlistener object to listen to sensor and reload onsensorchanged

Method.

D. register the corresponding sensorservice.

E. Destroy the corresponding sensorservice.

[Several commonly used induction models]

Sample: gravity acceleration.

Sample: Flip the phone to stop playing the song, and start playing the song on the front. The sensor orientation.

(6) How to Use

16. Sensor)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.