Adafruit & CircuitPython & Node.js All In One
Adafruit & CircuitPython & Node.js All In One
Node.js 版 package
没有的 Node.js 版 package
- 直接调用底层 C/C++ 库实现 ???
- 用 Node.js 手动实现底层逻辑 ???
- 使用 Node.js 在后台调用现成的 Python package,读写文件交换数据(Python 脚本写入文件,Node.js 读取文件) ???
参考 package:
https://github.com/orgs/adafruit/repositories?q=node&type=all&language=&sort=
https://github.com/rpi-ws281x/rpi-ws281x-python
https://github.com/jgarff/rpi_ws281x
https://github.com/richardghirst/rpi_ws281x
https://github.com/beyondscreen/node-rpi-ws281x-native
https://www.npmjs.com/package/rpi-ws281x-native
{
'conditions': [
# FIXME: check for architecture instead of OS, should only build on linux/arm/BCM2702
['OS=="linux"', {
'targets': [
{
'target_name': 'rpi_ws281x',
'sources': ['./src/rpi-ws281x.cc'],
'dependencies': ['rpi_libws2811'],
'include_dirs': ["<!(node -e \"require('nan')\")"],
'defines': ['NAPI_DISABLE_CPP_EXCEPTIONS'],
},
{
'target_name': 'rpi_ws281x-version',
'type': 'none',
'sources': ['./src/rpi_ws281x/version'],
'actions': [{
'action_name': 'make_version_h',
'variables': {'version_file': './src/rpi_ws281x/version'},
'inputs': ['./tools/make-version-h.js', '<@(version_file)'],
'outputs': ['./src/rpi_ws281x/version.h'],
'action': ['node', './tools/make-version-h.js', '<@(version_file)', '<@(_outputs)'],
}]
},
{
'target_name': 'rpi_libws2811',
'type': 'static_library',
'dependencies': ['rpi_ws281x-version'],
'sources': [
"<!@(node -p \"require('fs').readdirSync('./src/rpi_ws281x').filter(f => (f.match(/\.c$/) && !f.match('main.c'))).map(f => 'src/rpi_ws281x/' + f).join(' ')\")"
],
'cflags!': ['-Wextra']
}
]
},
# OS != linux: provide a dummy-target that at least won't break the install here
{
'targets': [{
'target_name': 'rpi_ws281x',
'type': 'none',
'actions': [{
'action_name': 'not_supported_msg',
'inputs': [],
'outputs': ['--nothing-built--'],
'action': ['true'],
'message': '**** YOU ARE INSTALLING THIS MODULE ON AN UNSUPPORTED PLATFORM ****'
}]
}]
}]
]
}
https://github.com/beyondscreen/node-rpi-ws281x-native/blob/master/binding.gyp
https://github.com/beyondscreen/node-rpi-ws281x-native/blob/master/src/rpi-ws281x.cc
js
https://github.com/adafruit?q=&type=all&language=javascript&sort=
https://github.com/adafruit/circuitpython-repl-js
CircuitPython
https://github.com/adafruit/circuitpython
MicroPython
https://github.com/micropython/micropython
demos
(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!
refs
©xgqfrms 2012-2021
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/17410821.html
未经授权禁止转载,违者必究!