0

我是 C 的超级新手,我通常使用 javascript,但我正在开发一个硬件项目,并且没有我能找到的 js 库。我正在使用带有 esp8266 节点 mcu 的 MD_MAX7219 led 矩阵,并且正在使用 mongoose os basic c github repomos clone https://github.com/mongoose-os-apps/empty

我可能没有C以正确的方式使用,但我想我会试一试。无论如何,我会找到一些好的 C 教程,但想看看我是否可以阅读文档并让它工作。

我有以下代码无法构建mos build

#include "mgos.h"
#include "MD_MAX72xx.h"

MD_MAX72XX(13, 14, 15, 1);

void begin(void)

    bool drawLine(0, 0, 1, 5, bool state);

mos.yml

author: mongoose-os
description: A Mongoose OS app skeleton
version: 1.0

libs_version: ${mos.version}
modules_version: ${mos.version}
mongoose_os_version: ${mos.version}

# Optional. List of tags for online search.
tags:
  - c

# List of files / directories with C sources. No slashes at the end of dir names.
sources:
  - src

# List of dirs. Files from these dirs will be copied to the device filesystem
filesystem:
  - fs

libs:
  - origin: https://github.com/mongoose-os-libs/boards
  - origin: https://github.com/mongoose-os-libs/ca-bundle
  - origin: https://github.com/mongoose-os-libs/rpc-service-config
  - origin: https://github.com/mongoose-os-libs/rpc-service-fs
  - origin: https://github.com/mongoose-os-libs/rpc-uart
  - origin: https://github.com/mongoose-os-libs/md-max72xx
  - origin: https://github.com/mongoose-os-libs/arduino-compat

# Used by the mos tool to catch mos binaries incompatible with this file format
manifest_version: 2017-09-29

我收到以下错误

unknown type name 'class'
  284 | class MD_MAX72XX
      | ^~~~~
/data/fwbuild-volumes/2.18.0/apps/mdmax72/esp8266/build_contexts/build_ctx_776553971/deps/md-max72xx/include/MD_MAX72xx.h:285:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
  285 | {
      | ^
/data/fwbuild-volumes/2.18.0/apps/mdmax72/esp8266/build_contexts/build_ctx_776553971/src/main.c:21:12: error: expected declaration specifiers or '...' before numeric constant
   21 | MD_MAX72XX(13, 14, 15, 1);

所以我猜我需要以不同的方式实例化这个类。不确定,提前谢谢

4

0 回答 0