// MICROPYTHON CALLS

API Reference

Function groups and constants from the linked Jumperless Temporal Badge API Reference. The exhaustive reference is also available on-device as /API_REFERENCE.md.

Init OLED Display Native UI Chrome Buttons & Joystick LED Matrix Matrix App Host IMU Haptics IR Identity Script Control Mouse Overlay Constants

// INIT

Init

init() initializes the badge runtime bindings.

// DISPLAY

OLED Display

Text

oled_print(text), oled_println(text), oled_set_cursor(x, y), oled_set_text_size(size)

Refresh

oled_clear([show]), oled_show(), oled_invert(enable)

Fonts

oled_set_font(name), oled_get_fonts(), oled_get_current_font()

Pixels

oled_set_pixel(x, y, color), oled_get_pixel(x, y), oled_draw_box(x, y, w, h), oled_set_draw_color(color)

Measure

oled_text_width(text), oled_text_height()

Framebuffer

oled_get_framebuffer(), oled_set_framebuffer(data), oled_get_framebuffer_size()

// CHROME

Native UI Chrome

Layout

ui_header(title, [right]), ui_action_bar(...), ui_chrome(...)

Hints

ui_inline_hint(x, y, hint), ui_inline_hint_right(right_x, y, hint), ui_measure_hint(hint)

// INPUT

Buttons & Joystick

Buttons

button(id), button_pressed(id), button_held_ms(id)

Joystick

joy_x(), joy_y()

Constants

BTN_RIGHT, BTN_DOWN, BTN_LEFT, BTN_UP, BTN_CONFIRM, BTN_BACK

// LEDS

LED Matrix

Draw

led_brightness(value), led_clear(), led_fill([brightness]), led_set_pixel(x, y, brightness), led_get_pixel(x, y)

Images

led_show_image(name), led_set_frame(rows, [brightness])

Animation

led_start_animation(name, [interval_ms]), led_stop_animation()

Override

led_override_begin(), led_override_end()

// BACKGROUND MATRIX

Matrix App Host

matrix_app_start(callback, [interval_ms], [brightness]), matrix_app_set_speed(interval_ms), matrix_app_set_brightness(brightness), matrix_app_stop(), matrix_app_active(), and matrix_app_info().

// MOTION

IMU

imu_ready(), imu_tilt_x(), imu_tilt_y(), imu_accel_z(), imu_face_down(), and imu_motion().

// FEEDBACK

Haptics

haptic_pulse([strength], [duration_ms], [freq_hz]), haptic_strength([value]), haptic_off(), tone(freq_hz, [duration_ms], [duty]), no_tone(), and tone_playing().

// COMMS

IR Send/Receive

Mode

ir_start(), ir_stop(), ir_flush()

Simple Frames

ir_send(addr, cmd), ir_available(), ir_read()

Word Frames

ir_send_words(words), ir_read_words()

Power

ir_tx_power([percent])

// IDENTITY

Badge Identity & Boops

my_uuid() returns this badge identity. boops() returns boop state.

// CONTROL

Script Control & Files

Use exit() to return to firmware. Dev builds also expose dev(*args). Filesystem access uses standard open() and os APIs.

// POINTER

Mouse Overlay

Enable

mouse_overlay(enable), mouse_set_bitmap(data, w, h)

Position

mouse_x(), mouse_y(), mouse_set_pos(x, y)

Input

mouse_clicked(), mouse_set_speed(speed), mouse_set_mode(mode)

// CONSTANTS

Constants Reference

Group Constants
Buttons BTN_RIGHT, BTN_DOWN, BTN_LEFT, BTN_UP, BTN_CIRCLE, BTN_CROSS, BTN_SQUARE, BTN_TRIANGLE, BTN_CONFIRM, BTN_SAVE, BTN_BACK, BTN_PRESETS
LED Images IMG_SMILEY, IMG_HEART, IMG_ARROW_UP, IMG_ARROW_DOWN, IMG_X_MARK, IMG_DOT
LED Animations ANIM_SPINNER, ANIM_BLINK_SMILEY, ANIM_PULSE_HEART
Mouse Modes MOUSE_ABSOLUTE, MOUSE_RELATIVE