Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We will create a simple App with a Button and an LED. This app is also available in the store as the “Button and Led” App.LED

Search for “Button” in the top left hand corner of the App Builder and drag the Interface button onto the canvas. Make sure the color of that object is green, as that represents graphical objects.

...

Since the Quantum Platform is really about hardware, lets add some. In this step we will go ahead and connect a button and LED to a Builder Base , which will also trigger the color picker to show #FFFFFFand replicate the same behavior in the dashboard in the same way in hardware.

For this step you’ll need the following parts:

  • Breadboard

  • Button

  • LED

  • Builder Base

  • Jumper Wires

Below you see the wiring diagram used in this app. The LED will be connected to GP1, while the Button will be connected to GP0.

...

Since the hardware is assembled now, we need to create a representation of this in the app. Go ahead and edit the current First App.

Search for Button and add the Hardware variant to the canvas.

...

Now go ahead and do the same thing for the LED.

...

After both hardware objects are in the canvas we have to connect these in a way, that the hardware responds to dashboard and vise versa. In order to do so connect the State of the hardware button to the hardware led and the color of the interface color picker. Following this connect the interface button to the hardware led.

The app should look like this now:

...

Save the app and exit the app builder.

Step 3 - Create & Flash Firmware

We are almost there. We wrote the app and connected the hardware components to the Builder Base. Now we have to create and flash a firmware, that represents the hardware components and wiring onto the Builder Base.

Navigate to the Firmware view and create a new firmware.

...

Now we add a Digital In, which will represent the hardware button. Search for the Digital In and name it Button. Open up the configuration of the Digital In Button by clicking the arrow at the end of the item.
Select the following values:

  • Driver: GPIO

  • Pin: GP0

  • Debounce: Enabled

  • Pin Mode: Input Pull Down ( We pull down the 3.3V, when pressing the Button).

...

For the LED add a LED hardware and call it LED. Select the following values:

  • Driver: GPIO

  • Pin: GP1

  • Mode: Initially Low ( We want the LED to be initially off)

Save the firmware.