pebble
  • Tutorials
  • Get the SDK
  • Guides
  • Documentation
  • PebbleOS
  • Mobile App
  • Examples
  • Index 01
  • Community
  • Blog
  • More
Privacy
Cookies
Publish

PebbleOS

  • Overview
  • Start here
    • Getting started guide
    • Playground
  • Development
    • The pbl CLI
    • Build system
    • Samples
      • Kernel
      • Subsystems
      • Drivers
      • Third-party
      • Rust
      • Benchmarks
    • Emulator and simulator
    • Testing
    • Debugging
    • Conventions
  • System
    • Architecture overview
    • Kernel
    • Subsystems
    • Drivers
    • Services
    • Libraries
    • Third-party
    • Application SDK
  • Hardware
    • Boards
    • Programmers
  • Community
    • Contribution Guidelines
  • Reference
    • Reference
    • Kconfig options

LVGL: Music player

This sample runs the music player demo that comes with LVGL: a screen full of artwork, text and an animated spectrum that plays by itself and follows the touchscreen. It enables the demo and the fonts it uses with LVGL’s own options in its prj.conf, and what the board needs, such as its GPU, in boards/<board>.conf.

Unlike the other samples it does not end.

Run:

pbl samples samples/third_party/lvgl/music

Boards:

every board

Sources

src/main.c
#include <stdio.h>

#include <pbl/kernel/delay.h>

#include <demos/lv_demos.h>
#include <pbl_lvgl.h>

int main(void) {
  int ret;

  ret = pbl_lvgl_init();
  if (ret != 0) {
    fprintf(stderr, "lvgl: init failed (%d)\n", ret);
    return ret;
  }

  /* The demos come with LVGL, each enabled by its CONFIG_LV_USE_DEMO_* option. */
  lv_demo_music();

  printf("lvgl: music player on %dx%d\n",
         (int)lv_display_get_horizontal_resolution(pbl_lvgl_get_display()),
         (int)lv_display_get_vertical_resolution(pbl_lvgl_get_display()));

  while (true) {
    pbl_sleep_ms(lv_timer_handler());
  }
}

Output

lvgl: music player on \d+x\d+

Generated from PebbleOS 4bbc630fa. This page is maintained in the pebbleos repository: docs/samples/third_party/lvgl/music.md.

Overview

  • Sources
  • Output