zephyr/samples/boards/bbc_microbit/pong
Lingao Meng 786b9a0ad4 Bluetooth: Host: Add const prefix for UUID
Add const prefix for service uuid and char uuid.

Since Service UUID and Char UUID should not change in the service
definition, they are most reasonably defined as rodata, also for
save some ram footprint.

The field `attr->user_data` type is `void *`, as this PR change
all Service UUID to rodata, so there must add (void *) to avoid warning.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-12-07 16:16:43 +00:00
..
boards samples: boards: bbc_microbit: pong: use pwm-dt-spec 2022-07-08 14:08:47 +02:00
src Bluetooth: Host: Add const prefix for UUID 2023-12-07 16:16:43 +00:00
CMakeLists.txt samples: bbc_microbit: Align with recent changes in pwm_nrf5_sw driver 2022-04-22 09:43:26 +02:00
prj.conf drivers: pwm_nrf5_sw: Rename to pwm_nrf_sw 2023-08-16 16:33:03 +02:00
README.rst samples: bbc_microbit: cleanups 2020-05-13 19:51:01 +02:00
sample.yaml samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00

.. _microbit_pong:

BBC micro:bit pong game
#######################

Overview
********

Play pong over as single player or Bluetooth between two micro:bit
devices.

The game works by controlling a paddle with the two buttons of the
micro:bit (labeled A and B). Initially the playing mode is selected: use
button A to toggle between single- and multi-player, and press button B
to select the current choice. To start the game, the player with the
ball launches the ball by pressing both buttons.

When multi-player mode has been selected the game will try to look for
and connect to a second micro:bit which has also been set into multi-
player mode.

If the board has a piezo buzzer connected to pin 0, this will be used to
generate beeps whenever the ball hits a wall or the paddle.

Building and running
********************

.. zephyr-app-commands::
   :zephyr-app: samples/boards/bbc_microbit/pong
   :board: bbc_microbit
   :goals: build flash
   :compact: