Site icon 지락문화예술공작단

Windows 10 IoT Core Blockly

Windows 10 IoT Core Blockly

In this blog post you’ll learn about IoT Core Blockly, a new UWP application that allows you to program a Raspberry Pi 2 or 3 and a Raspberry Pi Sense Hat using a “block” editor from your browser:

You create a program with interlocking blocks, which will run on the Raspberry Pi. For example, you can control the LED matrix on the Sense Hat and react to the inputs (buttons, sensors like temperature, humidity, etc.).

IoT Core Blockly was inspired by these other super interesting projects:

In this blog post, we will show you how to set up your Raspberry Pi with IoT Core Blockly and get coding with blocks.

Also, we’ll open the hood and look at how we implemented IoT Core Blockly leveraging Windows 10 IoT Core, Google Blockly, the Sense Hat library and the Chakra JavaScript engine.

Set up IoT Core Blockly on your Raspberry Pi

What you will need:

First, unpack your Sense Hat and connect it on top of the Raspberry Pi (having four small spacers is handy, but not required):

Now you will need to install the latest Windows IoT Core 10 Insider Preview on your SD card. Follow the instructions at www.windowsondevices.com in the “Get Started” section:

At this point, you should have the IoT Dashboard up and running on your Windows 10 desktop (or laptop) and your Raspberry Pi connected to the network (either Ethernet or Wireless). You should be able to see your Raspberry Pi on the IoT Dashboard “My devices” section:

In IoT Dashboard, go to the section called “Try some samples.” You will see the IoT Core Blockly sample:

Click on it and follow the instructions to install the UWP application onto your Raspberry Pi. After a few seconds, IoT Dashboard will open your favorite browser and connect to the IoT Core Blockly application running on your Raspberry Pi:

Press the “Run” button and the IoT Core Blockly application will start the “Heartbeat” program, and you should see a blinking red heart on your Sense Hat!

Try some other samples (the green buttons on the top). Select a sample, inspect the “blocks” in the editor and press the “Start” button to start this new program.

Try modifying an example: maybe a different image, color or message. IoT Core Blockly remembers the last program you run on the Raspberry Pi and will reload it when you start the Raspberry Pi again.

Under the hood

How does IoT Core Blockly work? How did we build it?

The code is on GitHub: https://github.com/ms-iot/samples/tree/develop/IoTBlockly.

You can clone the https://github.com/ms-iot/samples repo and load the IoTBlockly solution using Visual Studio 2015 Update 3.

The structure of IoT Core Blockly is simple:

If you inspect the IoTBlockly solution from GitHub, you can see 4 different projects:

Let us know if you want more details about how this works. We can definitely geek out more about this! J

Next steps

IoT Core Blockly is a functional sample, but we think we can do more. For example:

First, though, we want to hear from you J How you use IoT Core? What would you change or improve?

Don’t forget, IoT Core Blockly code is here on GitHub, and we gladly accept help, contributions and ideas!

Thanks for trying this out, and get started with Visual Studio!

Source: Windows 10 IoT Core Blockly

Exit mobile version