Peripheral commands and variables enable access to general purpose IOs (GPIOs), analog functions such as analog-digital converters (ADCs) and PWMs (Pulse Width Modulators). In the case of the ACKme Wahoo evaluation board, peripherals include the tri-color LED, the speaker, user buttons and the thermistor ADC.

Note that peripheral is used here in sense of an input or output device attached to the TruConnect device. This is not to be confused with a Bluetooth peripheral.


GPIO commands allow control of the function and direction of the GPIOs.

Typically, particular GPIOs are hard-wired to components such as LEDs, the speaker, and buttons. Other GPIOs are configurable for input and output.

GPIOs can be used for special system functions, including (but not limited to):

GPIO Functions and Pins

The table below shows functions, defaults and pins for the Bobcat GPIOs.

In the following examples, the Wahoo evaluation board is used to demonstrate GPIO functions. The table also shows defaults, connections and header pins for the AMS001-E01.2 Wahoo.

Bobcat AMS001, AMS002Wahoo AMS001-E01.2
GPIODefaultADCPWMPinDefaultConnectionsHeader Pin
for future use as i2c_sda, spi_mosi
4ReservedDo not connectH1-1
for future use as i2c_scl, spi_clk
5ReservedDo not connectH1-2
GPIO6none, factory11none, factoryButton 1, factory resetH1-7
GPIO7Reserved12ReservedDo not connectH1-8
GPIO9none14mode_selButton 2, bus mode, wakeH2-6
GPIO10noneADCPWM15status_ledBlue tri-color LEDH2-5
GPIO11noneADCPWM16noneGreen tri-color LEDH2-4
GPIO14noneADCPWM20stream_gpioRed tri-color LEDH2-1

Viewing GPIO Usage

To see the current GPIO usage, read the GPIO usage variable. The default Wahoo GPIO usage is:

> get gp u
!  # Description
#  0 i2c_sda
#  1 i2c_scl
#  2 user_tx
#  3 none
#  4 none
#  5 user_rx
#  6 none,factory
#  7 reserved
#  8 none
#  9 mode_sel
# 10 status_led
# 11 none
# 12 none
# 13 speaker
# 14 stream_gpio

Note: The user_rts and user_cts functions automatically override any other function configured on GPIO2 & GPIO3 when UART flow control is enabled using the ua f variable. The UART flow control functions cannot be set manually using the gfu command.

Setting GPIO Function

Use the GPIO function command to set a single GPIO to a specific function.

After using gfu, it may be necessary to save then reboot depending on the alternate function (some functions are only configured at boot up).

Use gdis command to set stdio function and direction for multiple GPIOs. See Setting and Getting Multiple STDIO GPIO Values below.

Available functions are listed in the gfu command documentation.

The gfu command fails if the GPIO is already configured for an alternate function. Disable the alternate function first by using gfu <GPIO#> none.

For example, to disable the beep command and allow the Wahoo speaker GPIO to operate as stdio:

> gfu 13 none
> gfu 13 stdio

After these commands, get gp u lists GPIO 13 as stdio and the beep command fails:

> get gp u
!  # Description
# 13 stdio,hiz
beep 100
Command failed

To use the Wahoo red LED to indicate when stream mode is on:

> gfu 14 none
> gfu 14 stream_gpio
> save
> reboot

Press Button 2 to toggle between command mode and stream mode. The Wahoo red LED comes on for stream mode. The Wahoo green LED may also be on or blinking, as it defaults to the status_led function.

Setting and Getting a Single STDIO GPIO Value

To set and get the value of a single GPIO, use the gse and gge commands.

Note that to set a GPIO, the GPIO must have stdio function and the output direction. To get the value, the GPIO must have stdio function. See Setting GPIO Function.

For example:

> gdi 12 olo
> gge 12
> gse 12 1
> gge 12

Setting and Getting Multiple STDIO GPIO Values

To set and get multiple stdio GPIO values, use the gses and gges commands.

For example, for the Wahoo evaluation board, set GPIO 6 (Button 1) and GPIO 8 (Button 2) as stdio pull-down inputs, and GPIO 10 (green LED), GPIO 11 (blue LED) and GPIO 14 (red LED) as stdio outputs.

> gdis 666666166133663

With no buttons pressed, get the values of the stdio GPIOs:

> gges

Now turn the red LED on:


Press both buttons and get the values of the stdio GPIOs:

> gges


To read the value from an ADC, use the adc command. For example, to read the Wahoo thermistor ADC value:

> adc 12

The value reported is in mV.

The ADC mV reading accuracy currently available is +/-10%. A future version of TruConnect will provide a calibration facility to improve accuracy to +/-3%.

To determine temperature from the Wahoo thermistor ADC, see Wahoo Thermistor Temperature vs ADC Value table.

The ADC value can be read regardless of the GPIO function setting.


The pwm command provides control of the frequency and duty cycle of a pulse width modulator output. PWMs are associated with specific GPIOs. The lowest possible frequency is about 128Hz, and the highest is 65536Hz.

The GPIO must be set to the pwm function. See gfu.

PWMs can be used for controlling the user LED and the speaker.


The level of a LED can be controlled via a GPIO, with either the stdio or pwm function.

The example below uses the Wahoo tri-color user LED. This contains a red, green and blue LED, which can be combined to form a wide range of colors:

Wahoo GPIOLED Color

These same GPIOs are associated with the Wahoo system indicator LEDs, if fitted.

GPIO control

The LEDs can be turned on or off individually by configuring them as output GPIOs, then setting the GPIO level. Note: GPIO 10 (green LED) defaults to the status_led function on Wahoo. It must be de-assigned to none before it can be used for another purpose.

To setup the tri-color LEDs:

TruConnect commandsComments

gfu 10 none
gfu 11 none
gfu 14 none
gfu 10 stdio
gfu 11 stdio
gfu 14 stdio
gdi 10 olo
gdi 11 olo
gdi 14 olo

Free up GPIO 10
Free up GPIO 11
Free up GPIO 14
Assign GPIO 10 to stdio function
Assign GPIO 11 to stdio function
Assign GPIO 14 to stdio function
Set red, green and blue GPIOs to output,
initial level low

Now you can turn on separate red, green and blue leds by setting GPIO values with the gse command. For example:

TruConnect commandsComments

gse 10 0
gse 11 0
gse 14 1

Turn green off
Turn blue off
Turn red on

PWM control

To set the Wahoo tri-colour LED to a color combining the three LEDs, issue three pwm commands, one for each LED GPIO.

First set each of the LED GPIOs to pwm function with the gfu command:

gfu 10 none
gfu 11 none
gfu 14 none
gfu 10 pwm
gfu 11 pwm
gfu 14 pwm

The ratio of low_count and high_count arguments determines the duty cycle of the PWM, as described in the pwm command documentation. The duty cycle impacts the brightness of the LED, lower duty cycles make the LED brighter. The lowest available PWM frequency, about 128Hz, may be used without any detectable flashing of the LED.

For example, to set the named color 'RebeccaPurple':

pwm 14 614 409
pwm 10 818 205
pwm 11 409 614

The Color PWM Table shows the pwm commands for a sample color range.


A speaker connected to a GPIO can be controlled with the PWM command or using the beep command.

The Wahoo speaker tone is controlled via GPIO 13 and a PWM. The pwm command documentation describes how to set the frequency and duty cycle of the PWM.

To set the pwm function on GPIO 13:

gfu 13 none
gfu 13 pwm

To play a middle C (C4), the command is: pwm 13 250 250

To turn the note off: pwm 13 stop

See the Musical Note PWM Table for pwm commands to play a range of notes on the speaker.

The beep command plays a tone of specified length through a speaker. To use this command, the GPIO wired to the speaker must be set to speaker function with the gfu command. See Setting GPIO Function above.

The following example shows how to set up the Wahoo speaker on GPIO 13 to allow the beep command, assuming GPIO 13 is currently set to another function:

> gfu 13 none
> gfu 13 speaker
> save
> reboot
> beep 100