Interplan IM920 library, 920MHz module

Dependents:   IM920_sample IM920_SDlog IM920_sample IM920_sample3 ... more

IM920 ライブラリ

データモード、低速、長距離 の設定で通信するライブラリです。

920MHz無線モジュール

http://www.interplan.co.jp/images/contents/solution/im920.png IM920 (インタープラン製)

  • mbedとモジュールとは、シリアル(TX,RX)、BUSY、RESET端子を接続します。
  • モジュールはあらかじめ、コマンドでノード番号などを設定しておきます。

NECの920MHz近距離無線モジュールもおすすめ

Revision:
2:0b47f6b25cc4
Parent:
1:81b2fd407327
Child:
3:db269462ad1c
--- a/IM920.cpp	Fri Dec 26 15:51:37 2014 +0000
+++ b/IM920.cpp	Mon Jan 05 03:47:08 2015 +0000
@@ -28,10 +28,9 @@
     setReset(false);
 }
 
-int IM920::init (int node, void(*func)()) {
+int IM920::init (int node) {
 
     _state.node = node;
-    _state.func = func;
 
     cmdRDID();
     cmdSTNN(_state.node);
@@ -43,8 +42,8 @@
 void IM920::poll () {
 
     if (_state.received && _state.buf != NULL)
-      if (_state.func != NULL && !_state.data->isEmpty()) {
-        _state.func();
+      if (!_state.data->isEmpty()) {
+        _func.call();
         if (_state.data->isEmpty()) {
             _state.received = false;
         }