Delphi XE10传感器如何进行操作?

更新于
2026-10-03 10:33:12
1阅读来源:SEO问题
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计287个文字,预计阅读时间需要2分钟。

伪原创开头内容:

`Sensor1: TMotionSensor; 加速传感器 Sensor1.Sensor(AngleAccelX, AngleAccelY, AngleAccelZ); 加速度 + procedure TAccelerometerForm.Timer1Timer(Sender: TObject); var LProp: TCustomMotionSensor.TProperty; begin for LProp in Moti`

MotionSensor1: TMotionSensor; 加速传感器 MotionSensor1.Sensor(AngleAccelX、AngleAccelY、AngleAccelZ)加速度
procedure TAccelerometerForm.Timer1Timer(Sender: TObject); var LProp: TCustomMotionSensor.TProperty; begin for LProp in MotionSensor1.Sensor.AvailableProperties do begin { get the data from the sensor } case LProp of TCustomMotionSensor.TProperty.AccelerationX: begin lbAccelerationX.Visible := True; lbAccelerationX.Text := Format(‘Acceleration X: %6.2f‘, [MotionSensor1.Sensor.AccelerationX]); end; end; end;
OrientationSensor1: TOrientationSensor;方位传感器 OrientationSensor1.Sensor(TiltX,TiltY,TiltZ)
procedure TOrientationSensorForm.Timer1Timer(Sender: TObject); begin { get the data from the sensor } lbTiltX.Text := Format(‘Tilt X: %f‘, [OrientationSensor1.Sensor.TiltX]); lbTiltY.Text := Format(‘Tilt Y: %f‘, [OrientationSensor1.Sensor.TiltY]); lbTiltZ.Text := Format(‘Tilt Z: %f‘, [OrientationSensor1.Sensor.TiltZ]); lbHeadingX.Text := Format(‘Heading X: %f‘, [OrientationSensor1.Sensor.HeadingX]); lbHeadingY.Text := Format(‘Heading Y: %f‘, [OrientationSensor1.Sensor.HeadingY]); lbHeadingZ.Text := Format(‘Heading Z: %f‘, [OrientationSensor1.Sensor.HeadingZ]); end; TSensorManager传感器管理器(包含上述两种传感器,Samples\Object Pascal\Mobile Samples\Device Sensors and Services\SensorInfo) TSensorCategory = (Location, Environmental, Motion, Orientation, Mechanical, Electrical, Biometric, Light, Scanner); 位置传感器,环境传感器,运动传感器,方向传感器,机械传感器,电传感器,生物传感器,光繁传感器,扫描仪传感器

更新日期:2019.07.05

本文共计287个文字,预计阅读时间需要2分钟。

伪原创开头内容:

`Sensor1: TMotionSensor; 加速传感器 Sensor1.Sensor(AngleAccelX, AngleAccelY, AngleAccelZ); 加速度 + procedure TAccelerometerForm.Timer1Timer(Sender: TObject); var LProp: TCustomMotionSensor.TProperty; begin for LProp in Moti`

MotionSensor1: TMotionSensor; 加速传感器 MotionSensor1.Sensor(AngleAccelX、AngleAccelY、AngleAccelZ)加速度
procedure TAccelerometerForm.Timer1Timer(Sender: TObject); var LProp: TCustomMotionSensor.TProperty; begin for LProp in MotionSensor1.Sensor.AvailableProperties do begin { get the data from the sensor } case LProp of TCustomMotionSensor.TProperty.AccelerationX: begin lbAccelerationX.Visible := True; lbAccelerationX.Text := Format(‘Acceleration X: %6.2f‘, [MotionSensor1.Sensor.AccelerationX]); end; end; end;
OrientationSensor1: TOrientationSensor;方位传感器 OrientationSensor1.Sensor(TiltX,TiltY,TiltZ)
procedure TOrientationSensorForm.Timer1Timer(Sender: TObject); begin { get the data from the sensor } lbTiltX.Text := Format(‘Tilt X: %f‘, [OrientationSensor1.Sensor.TiltX]); lbTiltY.Text := Format(‘Tilt Y: %f‘, [OrientationSensor1.Sensor.TiltY]); lbTiltZ.Text := Format(‘Tilt Z: %f‘, [OrientationSensor1.Sensor.TiltZ]); lbHeadingX.Text := Format(‘Heading X: %f‘, [OrientationSensor1.Sensor.HeadingX]); lbHeadingY.Text := Format(‘Heading Y: %f‘, [OrientationSensor1.Sensor.HeadingY]); lbHeadingZ.Text := Format(‘Heading Z: %f‘, [OrientationSensor1.Sensor.HeadingZ]); end; TSensorManager传感器管理器(包含上述两种传感器,Samples\Object Pascal\Mobile Samples\Device Sensors and Services\SensorInfo) TSensorCategory = (Location, Environmental, Motion, Orientation, Mechanical, Electrical, Biometric, Light, Scanner); 位置传感器,环境传感器,运动传感器,方向传感器,机械传感器,电传感器,生物传感器,光繁传感器,扫描仪传感器

更新日期:2019.07.05