パッケージ、リポジトリ、アプリカテゴリを検索

GitHub リポジトリyeikel16/ir_sensor_plugin

ir_sensor_plugin

このプラグインを使用すると、Flutterアプリケーションで赤外線センサーを利用できます。

ir_sensor_plugin のプロジェクト画像
スター
18
フォーク
10
最終プッシュ(UTC)
2024/12/14
プロジェクト状態
公開中

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

ir_sensor_plugin

This plugin allows Flutter applications to make use of the Infrared Sensor.

Usage

Support only for Android. If the plugin is invoked on iOS, it will crash your app. Added permission in the Manifests:

    <uses-permission android:name="android.permission.TRANSMIT_IR" />

How to use the methods

Check whether the device has an infrared emitter. Returns "true" if the device has an infrared emitter, else "false" .

final bool hasIrEmitter = await IrSensorPlugin.hasIrEmitter;

Query the infrared transmitter's supported carrier frequencies in Hertz.

final String getCarrierFrequencies = await IrSensorPlugin.getCarrierFrequencies;

Change the frequency with which it is transmitted. Default is 38020 Hz

final String result = await IrSensorPlugin.setFrequencies(40000);

Transmit an infrared pattern, return a String "Emitting" if there was no problem in the process.

The value pattern has to be a string that contains the behavior in HEX, example:

static const TV_POWER_HEX = "0000 006d 0022 0003 00a9 00a8 0015 003f 0015 
003f 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 003f 
0015 003f 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 
0015 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 
0015 0040 0015 0015 0015 003f 0015 003f 0015 003f 0015 003f 0015 003f 0015 
003f 0015 0702 00a9 00a8 0015 0015 0015 0e6e";

final String result = await IrSensorPlugin.transmitString(pattern: TV_POWER_HEX);

The value list has to be a list of Int, for example:

var power = [169,168,21,63,21,63,21,63,21,63,21,63,21,63,21,63,21,1794,169,168,21,21,21,3694];

final String result = await IrSensorPlugin.transmitListInt(list: power);

Getting Started

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Yeikel Uriarte Arteaga GitHub avatar
GitHub 作者

Yeikel Uriarte Arteaga ↗

Self-taught, I love teamwork and eager to learn, passionate about Flutter and Dart. Electronic, crypto enthusiast and lover of new technologies.

Cuba
言語DartJavaKotlin

使用している依存関係

依存関係一覧 2 件

  • flutter{"sdk":"flutter"}
  • flutter_test開発用{"sdk":"flutter"}

プロジェクトに合うリポジトリを選ぶには?

用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。

  1. 名前・作者・説明で検索し、技術トピックで絞り込みます。
  2. スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
  3. 利用前に GitHub で README、ライセンス、Issues を確認します。

情報源と管理

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗