HTE - Push Button

Overview

For Fullscreen: https://www.youtube.com/watch?v=TH9P9ffANyM

This tutorial will show you how to connect and use a pushbutton with the Quantum System.


Assemble the Circuit

As you can see the buttons connect both to a GP0 and GP1 Pin, but then one to the Ground Pin and one to the 3.3 V pin. That means, that you can connect the push button in two ways to the Builder Base. In case of the upper button, if you press it down it will ground and you will use the internal resistance of the Builder Base. A connected LED would only light up if you pull down the button and hold it. It’s called the pull down circuit. The other circuit is called the pull up circuit. When you don't press this button, the circuit is completely grounded. A connected LED would light up the hole time. But when you press the Button and hold it it will turn off.


Pair the Builder Base

Now we want to pair the Builder Base with our Q-Server. In order to do so, go to the Homescreen of your Q-Server.

Next click on the lift side symbol labeled “Clients”. Switch to the “Unpaired” tab at the top middle of the screen.

You should see your unpaired Builder Base. If not, check if you have plugged in the power supply for the Builder Base. Now move to the three dots below “Actions” and click “Pair”.

Once your Client is paired, click the “Setup” button.

Now you can edit your Client. Give him a Name you want and also a location where you are going to use it. Hit “Save” when you finished.


Build the Firmware

So once the Builder Base is paired and set up, we can start building our firmware. Move to the “Firmware” tab on the left side of your Q-Server interface. Hit “+ Create New”.

You will be prompted to give your new firmware a name. We named ours “Buttons”.

Once you created the new firmware, hit the “+ Add Hardware” button on the top, next to the “Actions” button.

We are going to search for a Button. You can use the search bar or scroll down till you find it. After this, you can give it a name and then click on “Add Hardware”. We named ours “Pull Down”. Then add a second Button which we name “Pull Up“.

Next we need to configure the firmware. Click on the Button firmware and choose these options:

The “Pin Mode” decides wether we will have a “Pull Down” or “Pull Up” button in our System. Do these steps also for the Pull Up Hardware but choose for the “Pin Mode” “Input Pull Up” now. Then click “Save”.

Next we have to upload the firmware file to our Builder Base. Click on the three dots below “Actions” and click on “Upload”.

Choose the correct Builder Base and hit “Upload”. You should see a progress bar pop up at the right side of your screen.


Build the App

While the firmware is uploading, we can build the application for our Button. Move to the “Apps” tab on the left side. Click on “Create New” and give it a name you want. We named ours again “Buttons”. Hit “Create”.

You will find yourself on the Canvas.

For this project we will need two Hardware LED-Objects, and two Hardware Button-Objects. Arrange and name them:

One LED and one Button will be the “Pull Down” system, the other one the “Pull Up” system. Click “Save App” on the top right. You will return to the first screen of the “Apps” tab. Now click the play button on the bar located at the right side.

Now we have to map the blue hardware objects we have put together before to the hardware. Click on the “Pull Up” tab and choose the Client, which is connected to the physical Button of the “Pull Up” system. Do this also for the other one and the LEDs.

Once you done click “Save + Run”.


Run the App!

In the following you can see the working circuit and systems:

As you can see, the green LED which ist the LED of the “Pull Up” system is lit up all the Time. When you push the lower Button now, the LED turns off.

To lit up the blue LED which is the LED of the “Pull Down” system you have to presse the upper Button:

The green and blue LED should light up.

This is how you connect and use a Push Button in two different ways with the Quantum System.

Happy Making!