[{"element_type":"text","content":"\n        \u003cp\u003eThis project is for kids\u003c/p\u003e\n\u003cp\u003edo you need a cookie watcher or a make sure your hidden stash of candy is safe?\u003c/p\u003e\n\u003cp\u003ewell WSS:bit is here for the job!\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eitems you need:\u003c/p\u003e\n      ","metadata":{}},{"element_type":"product","content":"https://www.adafruit.com/product/3530","metadata":{}},{"element_type":"parts","content":"\n  \u003cdiv class=\"parts-details\"\u003e\n    \u003cdiv\u003e\n      \u003cspan class=\"parts-quantity\"\u003e1\u003c/span\u003e\u003cspan\u003e x \u003c/span\u003e\n        \u003ca href=\"https://shop.elecfreaks.com/products/elecfreaks-micro-bit-smart-science-iot-kit-without-micro-bit-board?srsltid=AfmBOoqRzmwdMs0TPPyu9hebGjgOz2cygbAY0EDuPuPHCTmLgFmR8D_m\" class=\"parts-name\" target=\"_blank\"\u003eElecfreaks micro:bit iot kit\u003c/a\u003e\n      \u003cdiv class=\"parts-description\"\u003eELECFREAKS Smart Science IoT Kit is developed based on IOT:bit, a new breakout board compatible with science sensors such as the ultrasonic sensor, dust sensor, light sensor, and water level sensor, including RTC Timing and WIFI module. You can gather data via the sensors and send data to the cloud with a more stable and accurate data analysis.\u003c/div\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"parts-action\"\u003e\n  \u003cdiv\u003e\n      \u003ca href=\"https://shop.elecfreaks.com/products/elecfreaks-micro-bit-smart-science-iot-kit-without-micro-bit-board?srsltid=AfmBOoqRzmwdMs0TPPyu9hebGjgOz2cygbAY0EDuPuPHCTmLgFmR8D_m\" class=\"parts-url btn-primary\" target=\"_blank\"\u003eBuy Now\u003c/a\u003e\n\n  \u003c/div\u003e\n\u003c/div\u003e\n\n  \u003cdiv class=\"clearfix\"\u003e\u003c/div\u003e\n","metadata":{"name":"Elecfreaks micro:bit iot kit","url":"https://shop.elecfreaks.com/products/elecfreaks-micro-bit-smart-science-iot-kit-without-micro-bit-board?srsltid=AfmBOoqRzmwdMs0TPPyu9hebGjgOz2cygbAY0EDuPuPHCTmLgFmR8D_m","description":"ELECFREAKS Smart Science IoT Kit is developed based on IOT:bit, a new breakout board compatible with science sensors such as the ultrasonic sensor, dust sensor, light sensor, and water level sensor, including RTC Timing and WIFI module. You can gather data via the sensors and send data to the cloud with a more stable and accurate data analysis.","quantity":"1"}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eand tape or twisty ties\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"product","content":"https://www.adafruit.com/product/794","metadata":{}},{"element_type":"product","content":"https://www.adafruit.com/product/1536","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch2\u003estep 1 - building\u0026nbsp;\u003c/h2\u003e\n\u003cp\u003eOk, first take your iot:bit\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/513/original/IMG_0771.jpeg?1783339965","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003econnect the motion sensor and the sonar board\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/514/original/IMG_0776.JPG?1783339871","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/515/original/IMG_0779.JPG?1783339954","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eok now it is time to code! open \u003ca href=\"https://makecode.microbit.org/#\" target=\"_blank\"\u003emakecode microbit\u003c/a\u003e make a new project and put in this code\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"ESP8266_IoT.iotSwitchEvent(ESP8266_IoT.SmartIotSwitchState.off, function () {\n    watch_mode = false\n    can_beep = false\n})\nESP8266_IoT.iotSwitchEvent(ESP8266_IoT.SmartIotSwitchState.on, function () {\n    watch_mode = true\n    can_beep = true\n})\nlet watch_mode = false\nlet can_beep = false\nlet beeper_at_pin = 0\nlet other_items = false // set this to true if you added OLED and beeper\nESP8266_IoT.initWIFI(SerialPin.P8, SerialPin.P12, BaudRate.BaudRate115200)\nESP8266_IoT.connectWifi(\"your_ssid\", \"your_pwd\") // enter your wifi name and pw\nESP8266_IoT.connectSmartiot(\"\", \"\") // connecting to smartiot\nif (other_items) { //OLED and the beeper\n    OLED.init(128, 64)\n    beeper_at_pin = 4\n    can_beep = true\n}\nwatch_mode = true\nbasic.forever(function () {\n    if (watch_mode) {\n        if (Environment.PIR(DigitalPin.P1)) {\n            ESP8266_IoT.setSmartIotUploadData(\n            10\n            )\n            basic.showLeds(`\n                . . # . .\n                . . # . .\n                . . # . .\n                . . . . .\n                . . # . .\n                `)\n            basic.showIcon(IconNames.Angry)\n            flexFX.playFlexFX(flexFX.builtInFlexFX(flexFX.BuiltInFlexFX.Siren), true)\n            if (other_items) {\n                OLED.writeStringNewLine(\"YOU GET OUT\")\n                if (can_beep) {\n                    pins.digitalWritePin(beeper_at_pin, 1)\n                } else {\n                    pins.digitalWritePin(beeper_at_pin, 0)\n                }\n            }\n        } else {\n            basic.showIcon(IconNames.Heart)\n            basic.showIcon(IconNames.Heart)\n            basic.showIcon(IconNames.SmallHeart)\n            basic.showIcon(IconNames.SmallHeart)\n        }\n    }\n})\n","metadata":{"language":"javascript","filename":"micro-bit","linenums":false}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eplug in micro:bit to computer\u003c/p\u003e\n\u003cp\u003enow if you use chrome or fire fox or some thing that webusb works on click download and follow what it says\u003c/p\u003e\n\u003cp\u003eif using safari click download it should go to your downloads drag the hex file in to the MICROBIT drive and there your done!\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eif you want to add other items like the beeper and oled you can\u0026nbsp;\u003c/p\u003e\n\u003cp\u003efor oled plug the pins in to the black thing in below the microbit holder\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/517/original/IMG_0781.JPG?1783341405","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n        \u003cp\u003enow for the beeper take two female to female wires(one black and one yellow) and connect one end of the yellow wire to the beeper + and connect the other end to the yellow pin on port 4 on the iot:bit now get your black wire connect one end to beeper - and the other end to port 4 black pin and there your done!\u003c/p\u003e\n      \n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/518/original/IMG_0785.JPG?1783342040","metadata":{}},{"element_type":"text","content":"\n  \n  \n        \u003cp\u003eand your done go have fun drive people nut keep that candy safe!\u003c/p\u003e\n      \n\n","metadata":{}}]