|
Post by account_disabled on Jan 27, 2024 6:45:19 GMT 1
许多 Web 开发人员都希望有机会构建一个非常酷的机器人,他们可以通过 JavaScript 进行控制,对吗?我在这里告诉你,今天这已经成为可能!现在。 Backward Skip 10s Play Video Forward Skip 10s NodeBot 已经存在了一段时间,并且它们周围的社区正在像野火一样增长。在本文中,我将解释 NodeBot 是什么、它们如何工作以及如何开始修补机器人创建。 什么是微控制器? 在深入讨论之前,我们将经常提到微控制器。微控制器是一种微型且非常简单的计算机。它有一个简单的物理可编程电路板,可以检测各种输入并发送输出。Arduino 是一种微控制器。它实际上是新手尝试的最常见的方法之一。还有其他类型的微控制器也可以由 Node 提供支持,包括Particle 板(我最喜欢!)、BeagleBone 板、Tessel 板(板本身在 JS 上运行)和Espruino 板(也在 JS 上运行)。 在本文中,我将重点关注 Arduino,因为它们是最常见的。 什么是 NodeBot? NodeBot(从字面上看)是一种可以通过 Node.js 控制的机器人。它们可以拥有一切,从轮子、可移动的手臂和腿、运动探测器、摄像头、LED 显示屏、播放声音的能力等等。唯一的限制是 WhatsApp 号码数据 您的想象力以及您可以找到并组装的组件! Learn to Code with JavaScript NodeBots 的整个想法是通过 Node.js 功能的不断增强以及等一些开发人员的兴趣而演变的,他们致力于开发我们今天在 NodeBots 中使用的各种 Node 模块。Chris Williams 的名为node-serialport的 Node 包开始了这一切,允许通过低级别的串行端口读写来访问现实世界的设备。 Julian Gautier 随后实现了 Firmata 协议,该协议用于通过计算机上的软件访问 Arduino 等微控制器,并在他的 Node.js Firmata库中使用 JavaScript。 里克·沃尔德伦 (Rick Waldron) 又向前迈出了一大步。他使用 Firmata 库作为构建块,创建了一个名为Johnny-Five的完整 JavaScript 机器人和物联网编程框架。Johnny-Five 框架使得控制从 LED 到各种类型传感器的一切变得相对简单且轻松。这就是许多 NodeBot 现在用来实现一些令人印象深刻的壮举的方法! 从哪儿开始 如果您对构建机器人和任何类型的现实世界、JavaScript 控制的设备的想法完全陌生,那么有大量令人难以置信的资源可供您开始使用。我建议您做的第一件事就是为自己找到一个好的 Arduino 套件,它提供了一系列良好的组件和传感器,为您提供一系列可以使用的项目。下面,我列出了各公司提供的一些 Arduino 入门套件。如果下面的列表看起来令人难以承受,请不要担心!它们都包含非常相似的组件,对于初学者来说都是不错的选择。 入门套件 SparkFun 发明家套件。
|
|