The explosion of devices in the IoT space is more than a little overwhelming. Where do you start?

Why choose hardware when you can experiment entirely in software? That’s the power of the Device Simulator Express (DSE).

The DSE comes out of the Microsoft Garage internship program – two separate teams worked on the simulator over the past year. The development was done on GitHub and is open to contributors.

You can start experimenting with programming Python on IoT devices without buying anything – in fact, there’s nothing to buy at all. Everything you need is open-source and free.

Simulating devices in Visual Studio Code

There are three different simulators in the Device Simulator Express as of writing. The first is the Adafruit Circuit Playground Express, a circular device with two buttons, ten RGB NeoPixel LED lights, and a host of other sensors.

Adafruit's Circuit Playground Express device.

The Adafruit Circuit Playground Express.

In the DSE, you see a graphical representation of the device, and all of the buttons and touchpads work with mouse clicks. You write code in Python to control the Circuit Playground Express and then experiment with the simulation. In Visual Studio Code, you’ll see your code in one pane alongside the graphical device, so you experience the rapid-fire “write a line of code, run it, make changes” cycle that makes programming fun and easy to understand.

And when you’re ready to experiment on hardware, the Device Simulator Express extension makes it easy to push your code via USB into the IoT hardware.

And the Circuit Playground Express is not the only device in the simulator!

The BBC micro:bit is a small rectangular device with a five-by-five grid of LEDs, two buttons, and several other sensors.

The BBC micro:bit device.

The BBC micro:bit

The matrix of LEDs makes it easy to create simple graphical images, characters, and even animations. One of the more popular demo apps for the micro:bit is a dice simulation – you shake the device triggering the accelerometer (which you can do with your mouse in the DSE) and the micro:bit LEDs blink until they stop on a one-to-six die pattern.

Next up is the Adafruit CLUE, which is much like the micro:bit, but adds an LCD display instead of the matrix of LEDs.

The Adafruit CLUE device.

#python #visual studio code #code

IoT exploration with VS Code, Python, and the Device Simulator Express
2.75 GEEK