0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

M5NanoC6をZigbee調光電球[305.415.15]のリモコンにする(トグル)

0
Last updated at Posted at 2026-06-03

Screenshot From 2026-06-03 22-41-51.png

image_original(108).jpg

いろいろ注意

  • デジタル教育、非営利、調査研究目的で最小限引用しました。

結果

動いた

Screenshot From 2026-06-03 22-53-31.png

Screenshot From 2026-06-03 23-18-38.png

プログラム



#ifndef ZIGBEE_MODE_ZCZR
#error "Zigbee end device mode is not selected in Tools->Zigbee mode"
#endif

#include "Zigbee.h"

ZigbeeColorDimmerSwitch zb_switch = ZigbeeColorDimmerSwitch(1);

void setup() {
  Serial.begin(115200);

  Zigbee.addEndpoint(&zb_switch);
  Zigbee.setRebootOpenNetwork(180);

  Serial.println("Zigbee.begin()");
  if (!Zigbee.begin(ZIGBEE_COORDINATOR)) {
    Serial.println("Zigbee.begin() failed");
    abort();
  }

  Serial.println("Waiting for binding");
  while (!zb_switch.bound()) {
    Serial.print(".");
    delay(500);
  }
  Serial.print("\n");
}

void loop() {
  if (!zb_switch.bound()) {
    return;
  }

  zb_switch.lightToggle();
  delay(3000);
}



0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?