# Introduction to Python and C++

The SLM-RP4 runs Raspberry Pi OS, and the backplane is directly reachable from any program on the device. Two libraries are provided for this purpose:

- **`synergy_logic`**, a Python package.
- **`Synergy`**, a C++ library.

Both are preloaded on the device under the home directory of the `slm-rp4` user. See [Getting Started with Python](python/setup.md) and [Getting Started with C++](cpp/setup.md) for setup, examples and API reference.

## Recommended libraries

In addition to the Synergy libraries, the device runs a standard Raspberry Pi OS, so any Python or C++ library available on that platform can be installed and used. Common choices include:

- **NumPy, SciPy, pandas** for numerical processing.
- **OpenCV, Pillow** for image and video.
- **pyModbusTCP, pymodbus, libmodbus** for Modbus communications.
- **paho-mqtt, pyserial, requests** for messaging, serial, and HTTP integration.
- **RPi.GPIO, gpiozero, libgpiod** for GPIO beyond the backplane.

## Hardware watchdog

The base controller provides a user-programmable hardware watchdog. Once configured and started, the program is expected to reset ("pet") the watchdog on each cycle. If the program crashes or hangs, the watchdog expires, resets the base controller, and drives all outputs off (zero) without any software involvement.

The watchdog is independent of Linux and the Python or C++ runtime, and should be configured by any program that drives outputs. Example usage is in [Python: Examples](python/examples/watchdog.md) and the equivalent C++ page.
