【问题标题】:Arduino Makefile: How to save sensor data to file in the computer?Arduino Makefile:如何将传感器数据保存到计算机中的文件?
【发布时间】:2018-04-07 01:10:34
【问题描述】:

我在 Linux 上使用名为 Arduino Makefile 的命令行界面包。我在 Arduino Uno 上设置了一个传感器,将温度和湿度数据打印到 LCD 上。

我已经搜索了可能的解决方案,例如Save to CSV file from Arduino,其代码在不同的网站和论坛上重复出现,例如researchgate

我尝试使用他们的代码。但是,代码行:

import processing.serial.*;

给我错误:

thermo.ino:3:1: error: ‘import’ does not name a type
 import processing.serial.*;
 ^

如何解决这个错误?或者有没有其他方法可以将传感器数据保存到我计算机中存储的文件中?

顺便说一下,我的电脑是用USB线直接连接到Arduino Uno的。

【问题讨论】:

  • 处理与 Arduino 不同。

标签: c++ makefile arduino


【解决方案1】:

问题是您在 Arduino IDE 中运行该代码,但您必须在 Processing IDE 中运行它。

  1. here下载处理。
  2. 然后下载处理库here
  3. 解压缩库并将“Arduino”文件夹复制到 Processing Sketchbook 的“libraries”子文件夹中。在我的例子中是“C:\Users\Ricardo\Documents\Processing\libraries”。

现在在 Arduino IDE 中执行您从 mentioned before 的教程中获得的 first 代码。在 Processing IDE 中从该页面执行 second 代码。

应该可以!

注意:

这个link很有用

【讨论】:

  • 我没有使用 Arduino IDE,我使用的是 Arduino Makefile,它是一个命令行接口包。
  • okey 但你也必须使用处理,因为如果你按照我所说的步骤操作,arduino 语言没有“导入”,你将能够保存数据,或者使用 python 序列来获取值并将其保存在文件中
猜你喜欢
  • 2013-02-03
  • 2013-08-17
  • 1970-01-01
  • 2021-04-18
  • 1970-01-01
  • 1970-01-01
  • 2015-09-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多