GPIO driver for Analog Outputs

Introduction

The GPIO driver for Analog Outputs is used to modulate the pulse width on a pin of the Builder Base. This driver cannot alter the frequency, it is pure PWM.


Driver Parameters

The GPIO driver for Analog Outputs has one parameter that has to be configured:

Pin

This is the pin modulating the pulse width, any of the GP pins is suitable for this selection if not already used for other drivers. The Quantum System supports 8-bit (0-255) PWM.


Wiring

Example

The GP0 pin is connected to an LED, a current limiting resistor can be used but does not have to be because the GP source current is limited to 20mA.

 

Breadboard

Schematic

Used Pins

Used Pins

Description

Used Pins

Description

GP0 (can be any GP pin)

This pin modulates the pulse width

3.3V 

This pin provides the high level

GND

This pin provides the low level

How to write an App

Navigate to the App Builder and create a new application. You can find the “Analog Out” code object under the “Hardware” Tab in the object drop down menu on the left, or you can also use the search bar.

 

 

Drag the “Analog Out” Object onto the canvas.

 

 Next, locate the “Slider Analog” object under the “Interface” tab and drag it onto the canvas.

 

 

Finally, connect the value port on the Analog Slider to the value port on the Analog out Object.

 

 


How to create a firmware

Navigate to the Firmware Builder and create a new Firmware file.

 

 

Click the “+Add Hardware” button which will open a modal window. Scroll down in the list to find the “Generic” section and select the “Analog Out” hardware option.

Give your device a name and click “Add Device”

 

 

 

 

Next, select the “GPIO” driver under the driver dropdown menu.

Next, set the pin

For this example we will select:

  • Pin: GP0

 

 

 

You may now save your firmware file and upload it to one of your Builder Bases

 

 

 


Supported Hardware

  • LEDs

  • Buzzer


Downloads

Apps

Firmware

Assets