zephyr/samples/boards/bbc_microbit/pong
Tomasz Bursztyka e18fcbba5a device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.

A coccinelle rule is used for this:

@r_const_dev_1
  disable optional_qualifier
@
@@
-struct device *
+const struct device *

@r_const_dev_2
 disable optional_qualifier
@
@@
-struct device * const
+const struct device *

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
..
src device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
CMakeLists.txt samples: make find_package(Zephyr...) REQUIRED 2020-05-29 10:47:25 +02:00
README.rst samples: bbc_microbit: cleanups 2020-05-13 19:51:01 +02:00
prj.conf
sample.yaml sanitycheck: inclusive language 2020-08-27 07:04:07 -04:00

README.rst

.. _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: