Logo
9ced463ca 2025-02-01 16:05

User manual

  • Assembly
  • Getting started
  • Configuration
  • Updating firmware
  • Troubleshooting
  • Modifications
  • Hardware Specs

App programming

  • Blinky
  • Environment
  • Basics
  • Savefiles
  • bl00mbox
  • Fonts
  • Badge Link
  • Badge Net
  • I2C / Qwiic Expansions

App API

  • st3m.application module
  • st3m.input module
  • captouch module
  • st3m.ui.widgets module
  • ctx module
  • st3m.ui.colours module
  • leds module
  • st3m.ui.led_patterns module
  • st3m.ui.view module
  • audio module
  • badgelink module
    • Jack
      • Jack.active()
      • Jack.disable()
      • Jack.enable()
      • Jack.ring
      • Jack.tip
    • JackPin
      • JackPin.active()
      • JackPin.disable()
      • JackPin.enable()
      • JackPin.pin
    • left
    • right
  • badgenet module
  • uos module

OS programming

  • Structure
  • Development

OS API

  • sys_audio module
  • sys_display module
  • sys_kernel module

About

  • License
flow3r
  • badgelink module
  • Edit on GitLab

badgelink module

Note

See also: Badge link overview

Badge Link allows for multiple flow3r badges to connect together over the TRS jacks and exchange data. It also allows for flow3r badges to access the outside world over the same connector, even if that world is outside of the realm of usual audio frequencies. Think: eurorack control voltages, MIDI, …

Currently the API is very spartan, and only exposes Jack objects for the left and right TRRS jack. These Jack objects in return have standard micropython ESP32 Pin objects on which you can instantiate other micropython ESP32 objects, like UART, PWM, etc.

We hope to have a high-level API that allows actually establishing connectivity between two badges very soon :).

Sample usage:

>>> import badge_link
>>> badge_link.right
Jack(right)
>>> badge_link.right.active()
False
>>> badge_link.right.enable()
True
>>> badge_link.right.active()
True
>>> badge_link.right.tip
JackPin(right tip)
>>> badge_link.right.tip.pin
Pin(4)
>>> rt = badge_link.right.tip.pin
>>> rt.init(mode=machine.Pin.OUT)
>>> rt.on()
class badgelink.Jack(*args, **kwargs)
active() → bool

Returns true if this jack is currently fully enabled for badgelink, false if it’s in standard audio mode.

If only one of the pins is individually enabled, this method returns false.

disable() → None

Disable badgelink on this jack, returning it into audio mode.

This disables both pins (tip and ring) of this jack. They can also be individually disabled using the .pin.enable/.pin.disable methods.

enable() → bool

Enable badgelink on this jack, on both ring and tip connectors.

Enabling badgelink means that the given jack will not be used to pass through audio (ie. line out / headphones out on the left jack, and line in on the right jack). Instead, that jack will be connected to the ESP32’s pins, and normal ESP32 I/O operations can be performed on said pins.

True is returned if badgelink was succesfully enabled, false otherwies. Badgelink will fail to initialize on the left jack if nothing is currently plugged in (as a safety measure).

This enables both pins (tip and ring) of this jack. They can also be individually enabled using the .pin.enable/.pin.disable methods.

property ring: JackPin

Return the JackPin object for the ring of this jack.

This pin can be manipulated to perform I/O on the jack once it is in badgelink mode. It can also be used to individdually enable/disable badge link on this pin only.

property tip: JackPin

Return the JackPin object for the tip of this jack.

This pin can be manipulated to perform I/O on the jack once it is in badgelink mode. It can also be used to individdually enable/disable badge link on this pin only.

class badgelink.JackPin(*args, **kwargs)
active() → bool

Returns true if this pin is currently enabled for badgelink, false if it’s in standard audio mode.

disable() → None

Disable badgelink on this jack, returning it into audio mode.

enable() → bool

Enable badgelink on this jack, on both ring and tip connectors.

Enabling badgelink means that the given jack will not be used to pass through audio (ie. line out / headphones out on the left jack, and line in on the right jack). Instead, that jack will be connected to the ESP32’s pins, and normal ESP32 I/O operations can be performed on said pins.

True is returned if badgelink was succesfully enabled, false otherwies. Badgelink will fail to initialize on the left jack if nothing is currently plugged in (as a safety measure).

property pin: Pin

Return the GPIO Pin object for this jack pin.

This pin can be manipulated to perform I/O on the jack once it is in badgelink mode.

badgelink.left: Jack
badgelink.right: Jack
Previous Next

© Copyright 2023.

Built with Sphinx using a theme provided by Read the Docs.
firmware version: dev
dev
v1.0.0
v1.1.0
v1.1.1
v1.2.0
v1.3.0
v1.4.0