Arduino Quick Start
Open the Broadcast_Scan
example program included in the M5SwitchC6-ESP-NOW library, compile, and upload.
Press and hold the SwitchC6 button for 5 seconds, and it will broadcast its status information to nearby devices, including MAC address, channel, switch status, and capacitor voltage. Pressing the button briefly will first toggle the switch state, then broadcast the updated status. The main controller running this example program will scan and read these broadcasts, format the information, and print it to the serial port (nothing is displayed on the controller's screen), as shown:
First, obtain the MAC address of the SwitchC6 from the sticker or from the broadcast information.
Open the Controller
example program included in the M5SwitchC6-ESP-NOW library, enter the MAC address (format: XXXX-XXXX-XXXX
) of the SwitchC6 you want to control, along with the Wi-Fi SSID and password for the host, then compile and upload.
Tap the left button on the main controller's screen to turn on the switch, the middle button to turn it off, and the right button to query the switch status.