Skip to main content

Library Documentation

The IoT-environment-kit uses micro:bit as the main control board and Microsoft makecode platform as the programming platform. To facilitate users to program the iot-environment-kit, the ELECFREAKS team has developed the iot-environment-kit library file, and the iot-environment-kit contains 8 rainbow light ring components, so it needs to use the official neopixel library file as well. The following section describes in detail the role and parameter range of each programming command used in the kit:

FunctionCommondParameterDetails
ESP8266_IoTParameter 1 Type: Drop-down option
Parameter 1 Range: P0, P1, P2, P12, P13, P14, P15, P16, USB_TX, USB_RX
Parameter 2 Type: Drop-down option
Parameter 2 Range: P0, P1, P2, P8, P13, P14, P15, P16, USB_TX, USB_RX
Parameter 3 Type: Drop-down option
Parameter 3 Range: 115200, 57600, 38400, 31250, 28800, 19200, 14400, 9600, 4800, 2400, 1200
This command sets the default pin number and baud rate for ESP8266 signal transmission and reception, using the default RX: P8, TX: P12, and baud rate 115200.
Parameter 1 type: string
Parameter 1 range: 0-9, a-z, A-Z,
Parameter 2 type: string
Parameter 2 range: 0-9, a-z, A-Z,
This command is used to set the name and password of the WiFi connection, which is used to connect to the network.
Note: The 8266 module does not currently support 5G router WIFI signals, please connect to the 2.4G router WIKI signal
Parameter 1 type: drop-down option
Parameter 1 range: false, true
This command is used to determine whether ESP8266 is successfully connected to WiFi.
ThingSpeak/This command is used to connect to the Thingspeak platform
Parameter 1 type: string
Parameter 1 range: 0-9, a-z, A-Z, _
Parameter 2 type: number
Parameter 2 range: 0-9
This command is used to set the key and field of the ThingSpeak.
/This command is to upload data to the ThingSpeak platform
Parameter 1 type: drop-down option
Parameter 1 range: false, true
This command is used to check whether the connection to the ThingSpeak platform is successful.
OctopusParameter 1 type: drop-down option
Parameter 1 range: P0~P16
This command is to obtain the soil moisture sensor detection value
PinsParameter 1 type: drop-down option
Parameter 1 range: P0~P16
Parameter 2 type: number
Parameter 2 range: 0, 1
This command sets the high and low levels of the corresponding pins.
NeopixelParameter 1 type: drop-down options
Parameter 1 range: P0~P16
Parameter 2 type: number
Parameter 2 range: 1~+∞
Parameter 3 type: drop-down options
Parameter 3 range: RGB (GRB format), RGB+W, RGB (RGB format)
This command sets the control quantity and mode of the RGB light strip beads of the corresponding pin and assigns it to the variable
Parameter 1 type: drop-down options
Parameter 1 range: red,orange,yellow,green,blue,indigo,violet,purple,white,black
This command sets the color of the corresponding light bar.
Parameter 1 type: drop-down option
Parameter 1 range: set variable
This command sets the corresponding light bar color refresh
Parameter 1 type: drop-down option
Parameter 1 range: set variable
This command sets the corresponding light bar color to clear