Skip to main content

Краткое описание пустой библиотеки

Project description

I checked the link you shared — it’s the Elbear Arduino IDE Board Support Package (BSP) project on Gitflic, which is a Board Support Package for MIK32 “Амур”-based boards intended for use in Arduino IDE (not PlatformIO) — specifically supporting boards like ELBEAR ACE-UNO, ELBEAR ACE-NANO, ELSOMIK, and START-MIK32. (gitflic.ru)

This is not already a PlatformIO package — it’s written to integrate with Arduino’s Boards Manager via a JSON index in Arduino IDE. (gitflic.ru)


Can You Use This BSP in PlatformIO?

Yes — but you must manually import/adapt it, because PlatformIO does not automatically consume Arduino IDE board support packages distributed in this form.

What This BSP Contains

From the README:

  • Arduino core and variant files for MIK32 (Amur CPU)-based boards
  • Arduino-style libraries adapted for these MCUs
  • Board descriptions and behavior tailored for Arduino IDE
  • Instructions and special API behavior for GPIO, ADC, PWM, interrupts, etc. (gitflic.ru)

How to Import It into PlatformIO

There are two practical ways:


Option A — Create a Custom PlatformIO Platform

This is the cleanest way:

  1. Clone the BSP locally from the repository.

  2. Create a custom PlatformIO platform folder.

    Example structure inside your project:

    myproject/ platformio.ini custom_elbear_bsp/ platform.json boards/ elbear_ace_uno.json start_mik32.json framework-arduino-mik32/ cores/ variants/ libraries/

    Essentially transplant the Arduino IDE BSP into PlatformIO’s structure.

  3. Write platform.json to define your platform:

    { "name": "elbear_mik32", "title": "Elbear MIK32 Custom Platform", "version": "0.1.0", "frameworks": { "arduino": {} }, "packages": { "framework-arduino-mik32": { "type": "framework", "path": "framework-arduino-mik32" } } }

  4. Convert each board definition into PlatformIO JSON files in boards/.

    Example minimal:

    { "build": { "core": "mik32", "mcu": "mik32", "f_cpu": "80000000L", "variant": "ace_uno" }, "frameworks": ["arduino"], "name": "ELBEAR ACE-UNO", "upload": { "protocol": "serial", "speed": 115200 } }

  5. Use it in your platformio.ini:

    [env:elbear_ace_uno] platform = ./custom_elbear_bsp board = elbear_ace_uno framework = arduino

  6. Make sure to port any Arduino IDE build flags in the BSP’s platform.txt into PlatformIO’s build_flags.


Option B — Extend an Existing Platform

If the architecture of the MIK32 CPU is supported by an existing PlatformIO platform (e.g., if it’s GCC-ARM or another supported toolchain), you could:

  1. Pick the closest existing PlatformIO platform (for example, ststm32 or atmelavr, but only if binary toolchain is compatible).

  2. Add the core/variant files from the BSP manually via:

    • build_flags
    • board_build.core
    • board_build.variant
    • Custom include paths (-I)
  3. Create a custom board JSON in $HOME/.platformio/boards/ defining MCU, frequency, etc.

This is usually more fragile and only recommended if you know the underlying toolchain works.


Practical Tips

  • The BSP does not include a PlatformIO platform.json or board JSONs — you must add those yourself.
  • Arduino IDE boards.txt and platform.txt contain build flags that must be translated to PlatformIO’s format (build_flags, upload.protocol, etc.).
  • Upload protocol may need custom scripts if the BSP uses something non-standard.

Summary

  • The Elbear BSP you linked is for Arduino IDE and supports specific MIK32 boards. (gitflic.ru)

  • PlatformIO will not import it automatically — you must:

    1. Create a custom PlatformIO platform
    2. Or extend an existing platform by manually adding BSP files and board JSONs.

If you want, provide the specific board you’re targeting (e.g., ELBEAR ACE-UNO or START-MIK32) and I can help generate the necessary board JSON and platform.json boilerplate for PlatformIO.

import matplotlib.pyplot as plt import numpy as np from matplotlib.animation import FuncAnimation from collections import deque

═══════════════════════════════════════════════════════════════

🔧 НАСТРОЙКИ - МЕНЯЙТЕ ЗДЕСЬ

═══════════════════════════════════════════════════════════════

Названия для каждого из 5 графиков

GRAPH_TITLES = [ 'Температура', # График 1 'Влажность', # График 2 'Освещённость', # График 3 'Звук', # График 4 'Вибрация' # График 5 ]

Подписи Y-оси для каждого графика

Y_LABELS = [ '°C', # График 1 '%', # График 2 'Lux', # График 3 'dB', # График 4 'Уровень' # График 5 ]

Диапазоны значений (min, max) для каждого графика

Y_RANGES = [ (-10, 50), # График 1 (температура) (0, 100), # График 2 (влажность) (0, 1000), # График 3 (освещённость) (0, 100), # График 4 (звук) (-5, 5) # График 5 (вибрация) ]

Общие настройки

max_points = 100 # Количество видимых точек update_interval = 50 # мс между обновлениями fig_width = 15 # Ширина окна fig_height = 8 # Высота окна

================= СОЗДАНИЕ ОКНА =================

fig = plt.figure(figsize=(fig_width, fig_height)) axes = [] for i in range(5): if i < 3: ax = fig.add_subplot(2, 3, i + 1) else: ax = fig.add_subplot(2, 3, i + 2) axes.append(ax)

================= ХРАНИЛИЩЕ ДАННЫХ =================

data_buffers = [deque(maxlen=max_points) for _ in range(5)]

Инициализируем буферы начальными значениями

for i in range(5): for _ in range(max_points): data_buffers[i].append(0)

lines = []

================= НАСТРОЙКА ГРАФИКОВ =================

for i, ax in enumerate(axes): # X-ось всегда от 0 до max_points x = range(max_points) line, = ax.plot(x, list(data_buffers[i]), lw=2, color=f'C{i}') lines.append(line)

ax.set_xlim(0, max_points)
ax.set_ylim(Y_RANGES[i][0], Y_RANGES[i][1])
ax.set_title(f'{GRAPH_TITLES[i]}', fontsize=12, fontweight='bold')
ax.grid(True, alpha=0.3, linestyle='--')
ax.set_xlabel('Время →')
ax.set_ylabel(f'Значение ({Y_LABELS[i]})')

# Добавляем вертикальную линию для визуального эффекта
ax.axvline(x=max_points-1, color='red', alpha=0.3, linestyle=':', linewidth=1)

================= ОБНОВЛЕНИЕ =================

def update(frame): for i in range(5): # Добавляем новое случайное значение (автоматически удаляется старое) # Для реальных данных с Arduino замените эту строку на чтение из порта new_value = np.random.uniform(Y_RANGES[i][0], Y_RANGESi) data_buffers[i].append(new_value)

    # Обновляем линию
    lines[i].set_ydata(list(data_buffers[i]))

return lines

================= ЗАПУСК =================

ani = FuncAnimation(fig, update, interval=update_interval, blit=True) plt.tight_layout() plt.show()

import matplotlib.pyplot as plt import numpy as np from matplotlib.animation import FuncAnimation from collections import deque

GRAPH_TITLES = [ 'Температура',
'Влажность',
'Освещённость',
'Звук',
'Вибрация'
]

Y_LABELS = [ '°C',
'%',
'Lux',
'dB',
'Уровень'
]

Y_RANGES = [ (-10, 50),
(0, 100),
(0, 1000),
(0, 100),
(-5, 5)
]

max_points = 100
update_interval = 50
fig_width = 15
fig_height = 8

fig = plt.figure(figsize=(fig_width, fig_height)) axes = [] for i in range(5): if i < 3: ax = fig.add_subplot(2, 3, i + 1) else: ax = fig.add_subplot(2, 3, i + 2) axes.append(ax)

data_buffers = [deque(maxlen=max_points) for _ in range(5)]

for i in range(5): for _ in range(max_points): data_buffers[i].append(0)

lines = []

for i, ax in enumerate(axes): # x = range(max_points) line, = ax.plot(x, list(data_buffers[i]), lw=2, color=f'C{i}') lines.append(line)

ax.set_xlim(0, max_points)
ax.set_ylim(Y_RANGES[i][0], Y_RANGES[i][1])
ax.set_title(f'{GRAPH_TITLES[i]}', fontsize=12, fontweight='bold')
ax.grid(True, alpha=0.3, linestyle='--')
ax.set_xlabel('Время →')
ax.set_ylabel(f'Значение ({Y_LABELS[i]})')


ax.axvline(x=max_points-1, color='red', alpha=0.3, linestyle=':', linewidth=1)

def update(frame): for i in range(5):

    new_value = np.random.uniform(Y_RANGES[i][0], Y_RANGES[i][1])
    data_buffers[i].append(new_value)
    
    
    lines[i].set_ydata(list(data_buffers[i]))

return lines

ani = FuncAnimation(fig, update, interval=update_interval, blit=True) plt.tight_layout() plt.show()

Установка

pip install gerwg

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gerwg-0.1.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file gerwg-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gerwg-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0b5

File hashes

Hashes for gerwg-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c213ba051ef9bf2022599933716dc2ad60cfd1124d5378b1641900f104f225fc
MD5 5d718bc0d4395157b1d7716d875bd34b
BLAKE2b-256 03a455ba9943d71cbda862d35710f8e15d98e9f6788880d9e09e220553ac3cb1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page