This section explains how to get the M5Stack up and running and set up.
In addition to the enclosed M5Stack (device) and USB cable, please bring your smartphone (or PC), mobile battery or USB adapter.
Step1. Launching the M5Stack
Press the button on the side of the device to start it up, or connect it to the power supply with the USB cable. Once booted, you will see the obniz logo on the display.
Step2. Connect to Wi-Fi.
After launching, the M5Stack is waiting for Wi-Fi settings.
With the help of the M5Stack, connect to the Wi-Fi provided by the M5Stack with your smartphone or PC and set the SSID and password from your browser.
If an error appears or the system fails to start, check Troubleshooting.
Step3. Execution of the program
Scan the QR code on the M5Stack display with your smartphone to open the program editor.
If you are using a PC
program editor. When prompted for the obnizID, enter the 8-digit Enter a number.
When you tap (or click) on [Run] at the top right of the program screen, the Run screen opens and you can see the program is executed.
Initially, the text input and LED on/off buttons are displayed, and pressing the button You can change the screen and turn on the LEDs on the M5Stack with
How to use obniz.js
Obniz.js 3.7.0 or later with Obniz.M5StackBasic()
. Then you can easily call the M5Stack functions and IO without being aware of them.
You can easily use the buttons and Grove.
Buttons.
let obniz = new Obniz.M5StackBasic("OBNIZ_ID");
obniz.onconnect = async () => {
obniz.buttonA.onchange = (flg)=>{
console.log(`buttonA state : ${flg}`);
};
}
Grove.
let obniz = new Obniz.M5StackBasic("OBNIZ_ID");
obniz.onconnect = async () => {
const speaker = obniz.wired("Grove_Speaker", { grove: obniz.grove0})
speaker.play(1000); //1000hz
await obniz.wait(1000);
speaker.stop();
}
Step4. M5Stack Power OFF
You can turn off the power by pressing the button on the side of the unit twice when the power is not being supplied by USB etc.